Skip to content

Commit

Permalink
ci: fixed nightly chaos workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl committed Aug 9, 2023
1 parent f0426bf commit 9bf32ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,15 @@ EOF

FROM build AS stress-test
WORKDIR /opt/vfps-stress
ENV DOTNET_CLI_HOME="/tmp/.dotnet"
# https://github.com/hadolint/hadolint/pull/815 isn't yet in mega-linter
# hadolint ignore=DL3022
COPY --from=docker.io/bitnami/kubectl:1.27.3@sha256:ee7ea608b35c09d5995d54c087d1f8ec7e820ad2e5031d60b55dd6cc720483e4 /opt/bitnami/kubectl/bin/kubectl /usr/bin/kubectl

COPY tests/chaos/chaos.yaml /tmp/
COPY --from=build-stress-test /build/publish .
USER 65534:65534
# currently running into <https://github.com/dotnet/runtime/issues/80619>
# when running as non-root.
USER 0:0
ENTRYPOINT ["dotnet"]
CMD ["test", "/opt/vfps-stress/Vfps.StressTests.dll", "-l", "console;verbosity=detailed"]

Expand Down
24 changes: 15 additions & 9 deletions tests/chaos/argo-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
spec:
entrypoint: run-chaos-and-test
serviceAccountName: chaos-mesh-cluster-manager
onExit: exit-handler
templates:
- name: test
container:
Expand All @@ -27,7 +28,7 @@ spec:
drop:
- ALL
privileged: false
runAsNonRoot: true
runAsNonRoot: false

- name: install-chaos
container:
Expand All @@ -46,6 +47,8 @@ spec:
- ALL
privileged: false
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532

- name: delete-chaos
container:
Expand All @@ -64,14 +67,17 @@ spec:
- ALL
privileged: false
runAsNonRoot: true
runAsUser: 65532
runAsGroup: 65532

- name: exit-handler
steps:
- - name: delete-chaos
template: delete-chaos

- name: run-chaos-and-test
dag:
tasks:
- name: test
template: test
- name: install-chaos
steps:
- - name: install-chaos
template: install-chaos
- name: delete-chaos
depends: "install-chaos && (test.Succeeded || test.Failed)"
template: delete-chaos
- - name: test
template: test

0 comments on commit 9bf32ac

Please sign in to comment.