Skip to content

Commit

Permalink
fix: jobs setup and improve default resources (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo authored Sep 24, 2024
1 parent a71daee commit e20548f
Show file tree
Hide file tree
Showing 28 changed files with 629 additions and 522 deletions.
72 changes: 54 additions & 18 deletions packages/kontinuous/tests/__snapshots__/app-simple-options.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: ghcr.io/socialgouv/docker/psql:6.70.0
Expand Down Expand Up @@ -197,8 +201,12 @@ spec:
set -e
/action/ensure-db.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -302,8 +310,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand Down Expand Up @@ -339,8 +351,12 @@ spec:
set -e
/action/create-secret.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down Expand Up @@ -457,8 +473,12 @@ spec:
- name: workspace
mountPath: /workspace
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: harbor.fabrique.social.gouv.fr/test-app-simple-options/app:sha-ffac537e6cbbf934b08745a378932722df287a53
Expand All @@ -478,8 +498,12 @@ spec:
set -e
yarn seed
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -587,8 +611,12 @@ spec:
- name: workspace
mountPath: /workspace
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
- name: degit-action
image: ghcr.io/socialgouv/kontinuous/degit:v1.181.2
command:
Expand All @@ -603,8 +631,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: ghcr.io/socialgouv/docker/psql:7.0.0
Expand All @@ -626,8 +658,12 @@ spec:
set -e
/action/seed-db.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down
16 changes: 12 additions & 4 deletions packages/kontinuous/tests/__snapshots__/deactivate.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand All @@ -92,8 +96,12 @@ spec:
kubectl delete namespace \\"$NAMESPACE\\" --now=true --wait=false
fi
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down
32 changes: 24 additions & 8 deletions packages/kontinuous/tests/__snapshots__/extends-ovh.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand Down Expand Up @@ -187,8 +191,12 @@ spec:
set -e
/action/create-secrets.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down Expand Up @@ -302,8 +310,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand Down Expand Up @@ -342,8 +354,12 @@ spec:
set -e
/action/create-secrets.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down
32 changes: 24 additions & 8 deletions packages/kontinuous/tests/__snapshots__/extends-ovh.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand Down Expand Up @@ -378,8 +382,12 @@ spec:
set -e
/action/create-secrets.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down Expand Up @@ -493,8 +501,12 @@ spec:
- name: action
mountPath: /action
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: bitnami/kubectl:latest
Expand Down Expand Up @@ -533,8 +545,12 @@ spec:
set -e
/action/create-secrets.sh
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1001
runAsGroup: 1001
Expand Down
16 changes: 12 additions & 4 deletions packages/kontinuous/tests/__snapshots__/include-file.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,12 @@ spec:
- name: workspace
mountPath: /workspace
resources:
limits: {}
requests: {}
limits:
cpu: 200m
memory: 100Mi
requests:
cpu: 64m
memory: 32Mi
containers:
- name: job
image: debian:stable
Expand All @@ -167,8 +171,12 @@ spec:
set -e
Hello World !
resources:
limits: {}
requests: {}
limits:
cpu: \\"3\\"
memory: 1Gi
requests:
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down
38 changes: 8 additions & 30 deletions packages/kontinuous/tests/__snapshots__/job-builds.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,6 @@ spec:
set -e
if [ \\"$status\\" -ne 0 ]; then
echo \\"Command failed. Handling error...\\"
if grep -q -e \\"listing workers for Build: failed to list workers: Unavailable\\" -e \\"closing transport due to: connection error\\" $tempfile; then
echo \\"buildkit optimized service unavailable, fallback to local build\\"
buildctl_cmd=\\"buildctl-daemonless.sh\\"
buildctl_options_mtls=\\"\\"
runBuildkit
else
exit $status
fi
fi
echo \\"build succeeded.\\"
Expand All @@ -302,11 +291,11 @@ spec:
echo \\"$IMAGE_PATH:sha-ffac537e6cbbf934b08745a378932722df287a53\\" >$KONTINUOUS_OUTPUT/IMAGE
resources:
limits:
cpu: \\"2\\"
memory: 8Gi
cpu: \\"3\\"
memory: 250Mi
requests:
cpu: 500m
memory: 4Gi
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -561,17 +550,6 @@ spec:
set -e
if [ \\"$status\\" -ne 0 ]; then
echo \\"Command failed. Handling error...\\"
if grep -q -e \\"listing workers for Build: failed to list workers: Unavailable\\" -e \\"closing transport due to: connection error\\" $tempfile; then
echo \\"buildkit optimized service unavailable, fallback to local build\\"
buildctl_cmd=\\"buildctl-daemonless.sh\\"
buildctl_options_mtls=\\"\\"
runBuildkit
else
exit $status
fi
fi
echo \\"build succeeded.\\"
Expand All @@ -580,11 +558,11 @@ spec:
echo \\"$IMAGE_PATH:sha-ffac537e6cbbf934b08745a378932722df287a53\\" >$KONTINUOUS_OUTPUT/IMAGE
resources:
limits:
cpu: \\"2\\"
memory: 4Gi
cpu: \\"3\\"
memory: 250Mi
requests:
cpu: 500m
memory: 1Gi
cpu: 64m
memory: 32Mi
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down
Loading

0 comments on commit e20548f

Please sign in to comment.