Skip to content

Commit b1f0870

Browse files
authored
Upgrade .net version and packages (#57)
* Upgrade .net version and packages * Add acceptance tests to the build * Try to fix * Fix * Add logs
1 parent 3d095f4 commit b1f0870

21 files changed

Lines changed: 598 additions & 32 deletions

.github/workflows/build.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: dotnet restore
2323
- name: Build
2424
run: dotnet build --no-restore
25-
- name: Test
25+
- name: Run unit tests
2626
working-directory: ./test/SnD.ApiClient.Tests
2727
run: |
2828
dotnet add package coverlet.msbuild &&
@@ -33,3 +33,19 @@ jobs:
3333
with:
3434
github-token: ${{ secrets.GITHUB_TOKEN }}
3535
lcov-file: ./test/Coverage/coverage.info
36+
37+
- name: Setup just
38+
uses: extractions/setup-just@v3
39+
40+
- name: Setup integration tests
41+
run: just up
42+
43+
- name: Run acceptance tests
44+
working-directory: ./test/SnD.ApiClient.Tests.Acceptance
45+
run: |
46+
dotnet test SnD.ApiClient.Tests.Acceptance.csproj --configuration Debug --runtime linux-x64
47+
48+
- name: Get logs from application pods
49+
if: always()
50+
run: |
51+
kubectl describe pods --namespace default || true

integration_tests/kind.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
nodes:
4+
- role: control-plane
5+
extraPortMappings:
6+
- containerPort: 80
7+
hostPort: 5555
8+
protocol: TCP
9+
- containerPort: 30043
10+
hostPort: 9000
11+
protocol: TCP
12+
- containerPort: 30042
13+
hostPort: 9042
14+
protocol: TCP
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
apiVersion: science.sneaksanddata.com/v1
2+
kind: NexusAlgorithmTemplate
3+
metadata:
4+
name: hello-world
5+
annotations:
6+
"helm.sh/hook": post-install,post-upgrade
7+
"helm.sh/hook-weight": "0"
8+
"helm.sh/hook-delete-policy": before-hook-creation
9+
spec:
10+
args:
11+
- main.py
12+
- '--sas-uri=%s'
13+
- '--request-id=%s'
14+
command: python
15+
computeResources:
16+
cpuLimit: 1000m
17+
memoryLimit: 1000Mi
18+
container:
19+
image: nexus-hello
20+
registry: ghcr.io/sneaksanddata
21+
serviceAccountName: nexus
22+
versionTag: 0.1.2
23+
datadogIntegrationSettings:
24+
mountDatadogSocket: true
25+
errorHandlingBehaviour:
26+
fatalExitCodes:
27+
- 137
28+
transientExitCodes:
29+
- 139
30+
runtimeEnvironment:
31+
deadlineSeconds: 120
32+
environmentVariables:
33+
- name: DD_AGENT_HOST
34+
valueFrom:
35+
fieldRef:
36+
fieldPath: status.hostIP
37+
- name: PROTEUS__DD_SITE
38+
value: datadoghq.eu
39+
- name: NEXUS__ALGORITHM_NAME
40+
value: nexus-hello
41+
- name: NEXUS__SCHEDULER_URL
42+
value: http://nexus.nexus.svc.cluster.local:8080
43+
- name: NEXUS__RECEIVER_URL
44+
value: http://dockerhost.nexus.svc.cluster.local:8081
45+
- name: NEXUS__STORAGE_CLIENT_CLASS
46+
value: adapta.storage.blob.s3_storage_client.S3StorageClient
47+
- name: ALGORITHM_STORAGE__BASE_PATH
48+
value: s3a://nexus/storage
49+
- name: NEXUS__ALGORITHM_OUTPUT_PATH
50+
value: s3a://nexus/result
51+
- name: NEXUS__TELEMETRY_PATH
52+
value: s3a://nexus/telemetry
53+
- name: ALGORITHM_STORAGE_TYPE
54+
value: S3
55+
- name: PROTEUS__AWS_REGION
56+
value: us-east-1
57+
- name: PROTEUS__AWS_ENDPOINT
58+
value: http://dockerhost.nexus.svc.cluster.local:9000
59+
- name: PROTEUS__AWS_SECRET_ACCESS_KEY
60+
value: minioadmin
61+
- name: PROTEUS__AWS_ACCESS_KEY_ID
62+
value: minioadmin
63+
mappedEnvironmentVariables: []
64+
maximumRetries: 1
65+
workgroupRef:
66+
group: science.sneaksanddata.com
67+
kind: NexusAlgorithmWorkgroup
68+
name: default
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: science.sneaksanddata.com/v1
2+
kind: NexusAlgorithmWorkgroup
3+
metadata:
4+
name: default
5+
annotations:
6+
"helm.sh/hook": post-install,post-upgrade
7+
"helm.sh/hook-weight": "1"
8+
"helm.sh/hook-delete-policy": before-hook-creation
9+
spec:
10+
affinity: {}
11+
cluster: kind-nexus-shard-0
12+
description: Default workgroup
13+
tolerations: []
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: networking.k8s.io/v1
2+
kind: Ingress
3+
metadata:
4+
name: receiver
5+
annotations:
6+
nginx.ingress.kubernetes.io/use-regex: "true"
7+
nginx.ingress.kubernetes.io/rewrite-target: /$2
8+
spec:
9+
ingressClassName: nginx
10+
rules:
11+
- http:
12+
paths:
13+
- pathType: ImplementationSpecific
14+
path: /receiver(/|$)(.*)
15+
backend:
16+
service:
17+
name: nexus-receiver
18+
port:
19+
number: 8080
20+
---
21+
apiVersion: networking.k8s.io/v1
22+
kind: Ingress
23+
metadata:
24+
name: scheduler
25+
annotations:
26+
nginx.ingress.kubernetes.io/use-regex: "true"
27+
nginx.ingress.kubernetes.io/rewrite-target: /$2
28+
spec:
29+
ingressClassName: nginx
30+
rules:
31+
- http:
32+
paths:
33+
- pathType: ImplementationSpecific
34+
path: /scheduler(/|$)(.*)
35+
backend:
36+
service:
37+
name: nexus
38+
port:
39+
number: 8080
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: minio
5+
labels:
6+
app: minio
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: minio
12+
template:
13+
metadata:
14+
labels:
15+
app: minio
16+
spec:
17+
hostname: minio-e2e
18+
containers:
19+
- name: minio
20+
image: quay.io/minio/minio
21+
args:
22+
- server
23+
- /data
24+
- "--console-address"
25+
- ":9123"
26+
ports:
27+
- containerPort: 9000
28+
- containerPort: 9123
29+
livenessProbe:
30+
httpGet:
31+
path: /
32+
port: 9123
33+
initialDelaySeconds: 30
34+
periodSeconds: 30
35+
timeoutSeconds: 10
36+
failureThreshold: 5
37+
readinessProbe:
38+
httpGet:
39+
path: /
40+
port: 9123
41+
initialDelaySeconds: 30
42+
periodSeconds: 30
43+
timeoutSeconds: 10
44+
failureThreshold: 5
45+
---
46+
apiVersion: v1
47+
kind: Service
48+
metadata:
49+
name: minio
50+
spec:
51+
selector:
52+
app: minio
53+
ports:
54+
- name: api
55+
port: 9000
56+
targetPort: 9000
57+
- name: console
58+
port: 9123
59+
targetPort: 9123
60+
type: ClusterIP
61+
---
62+
apiVersion: batch/v1
63+
kind: Job
64+
metadata:
65+
name: minio-setup
66+
spec:
67+
backoffLimit: 5
68+
template:
69+
spec:
70+
restartPolicy: OnFailure
71+
containers:
72+
- name: minio-setup
73+
image: quay.io/minio/minio
74+
command:
75+
- /bin/sh
76+
- -c
77+
- |
78+
echo "Waiting for Minio to be available via mc..."
79+
max_retries=30
80+
attempt=1
81+
until mc alias set e2e "http://minio.default.svc.cluster.local:9000" minioadmin minioadmin >/dev/null 2>&1; do
82+
if (( attempt >= max_retries )); then
83+
echo "minio did not become available after $max_retries attempts."
84+
exit 1
85+
fi
86+
sleep 1
87+
((attempt++))
88+
done
89+
echo "mc is available."
90+
mc admin info e2e
91+
mc mb --ignore-existing e2e/tmp
92+
mc mb --ignore-existing e2e/nexus
93+
mc mb --ignore-existing e2e/nexus-sdk-tests
94+
---
95+
apiVersion: v1
96+
kind: Service
97+
metadata:
98+
name: minio-node-port
99+
spec:
100+
selector:
101+
app: minio
102+
ports:
103+
- port: 9000
104+
targetPort: 9000
105+
nodePort: 30043
106+
type: NodePort
107+
---
108+
apiVersion: v1
109+
kind: Secret
110+
metadata:
111+
name: minio-credentials
112+
stringData:
113+
NEXUS__S3_BUFFER__ACCESS_KEY_ID: "minioadmin"
114+
NEXUS__S3_BUFFER__SECRET_ACCESS_KEY: "minioadmin"
115+
NEXUS__S3_BUFFER__ENDPOINT: "http://minio.default.svc.cluster.local:9000"
116+
NEXUS__S3_BUFFER__REGION: "us-east-1"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: nexus:serviceaccount:nexus
5+
subjects:
6+
- kind: ServiceAccount
7+
name: nexus
8+
namespace: default
9+
roleRef:
10+
apiGroup: rbac.authorization.k8s.io
11+
kind: ClusterRole
12+
name: admin
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: scylla
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: scylla
10+
template:
11+
metadata:
12+
labels:
13+
app: scylla
14+
spec:
15+
initContainers:
16+
- name: create-scylla-yaml
17+
image: busybox
18+
command: ["/bin/sh", "-c", "touch /scylla-conf/scylla.yaml"]
19+
volumeMounts:
20+
- name: scylla-conf
21+
mountPath: /scylla-conf
22+
containers:
23+
- name: scylla
24+
image: scylladb/scylla
25+
command: ["scylla"]
26+
args:
27+
- "--rpc-address"
28+
- "0.0.0.0"
29+
- "--broadcast-rpc-address"
30+
- "127.0.0.1"
31+
- "--smp"
32+
- "1"
33+
- "--developer-mode=1"
34+
livenessProbe:
35+
exec:
36+
command:
37+
- /bin/sh
38+
- -c
39+
- '[ "$(nodetool statusgossip)" = "running" ]'
40+
initialDelaySeconds: 30
41+
periodSeconds: 30
42+
timeoutSeconds: 10
43+
failureThreshold: 5
44+
volumeMounts:
45+
- name: scylla-conf
46+
mountPath: /conf/scylla.yaml
47+
subPath: scylla.yaml
48+
volumes:
49+
- name: scylla-conf
50+
emptyDir: {}
51+
---
52+
apiVersion: v1
53+
kind: Service
54+
metadata:
55+
name: scylla
56+
spec:
57+
selector:
58+
app: scylla
59+
ports:
60+
- name: cql
61+
port: 9042
62+
targetPort: 9042
63+
type: ClusterIP
64+
---
65+
apiVersion: v1
66+
kind: Secret
67+
metadata:
68+
name: cassandra-credentials
69+
stringData:
70+
NEXUS__SCYLLA_CQL_STORE__HOSTS: "scylla.default.svc.cluster.local"
71+
NEXUS__SCYLLA_CQL_STORE__USER: "cassandra"
72+
NEXUS__SCYLLA_CQL_STORE__PASSWORD: "cassandra"
73+
---
74+
apiVersion: v1
75+
kind: Service
76+
metadata:
77+
name: scylla-node-port
78+
spec:
79+
selector:
80+
app: scylla
81+
ports:
82+
- port: 9042
83+
targetPort: 9042
84+
nodePort: 30042
85+
type: NodePort

0 commit comments

Comments
 (0)