Skip to content

Commit

Permalink
ci: fixed nightly chaos workflow (#63)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
chgl authored Aug 9, 2023
1 parent ed5c36f commit bd6543d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3

- uses: iter8-tools/iter8@v0.13.18 # v0.13.18
- uses: iter8-tools/iter8@9b867240dcaa77858d2458f52a3845e47ea2c657 # v0.13.17

- name: Create KinD cluster
uses: helm/kind-action@9e8295d178de23cbfbd8fa16cf844eec1d773a07 # v1.4.0
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ 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.
# hadolint ignore=DL3002
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 bd6543d

Please sign in to comment.