diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index b7ed4f79f..c74599b0e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -182,6 +182,9 @@ jobs: build: name: Build Release runs-on: ubuntu-latest + env: + CRYSTAL_IMAGE: "conformance/crystal:0.35.1-llvm10-grep" + # if: needs.skip.outputs.skip == 'false' steps: - name: Checkout code uses: actions/checkout@v2 @@ -201,9 +204,9 @@ jobs: lib- - name: Build Release run: | - docker pull conformance/crystal:0.35.1 - docker run --rm -v $PWD:/workspace -w /workspace conformance/crystal:0.35.1-llvm10-grep shards install - docker run --rm -v $PWD:/workspace -w /workspace conformance/crystal:0.35.1-llvm10-grep crystal build --warnings none src/cnf-testsuite.cr --release --static --link-flags '-lxml2 -llzma' + docker pull $CRYSTAL_IMAGE + docker run --rm -v $PWD:/workspace -w /workspace $CRYSTAL_IMAGE shards install + docker run --rm -v $PWD:/workspace -w /workspace $CRYSTAL_IMAGE crystal build --warnings none src/cnf-testsuite.cr --release --static --link-flags '-lxml2 -llzma' - name: upload artifact uses: actions/upload-artifact@v2 with: @@ -213,6 +216,8 @@ jobs: setup_airgapped_env: name: Test Setup Command In An Airgapped Env. runs-on: [default] + env: + OFFLINE_IMAGE: "conformance/offline:latest" steps: - name: Checkout code uses: actions/checkout@v2 @@ -258,7 +263,7 @@ jobs: # gunzip airgapped.tar.gz cp -a $(pwd) /shared/$DIR/cnf-testsuite cp /tmp/airgapped.tar.gz /shared/$DIR/ - docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t conformance/offline:latest /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr setup offline=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr install_litmus offline=true; kubectl get deployment chaos-operator-ce --namespace litmus; ./.github/workflows/check_litmus.sh" + docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t $OFFLINE_IMAGE /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr setup offline=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr install_litmus offline=true; kubectl get deployment chaos-operator-ce --namespace litmus; ./.github/workflows/check_litmus.sh" - name: Delete Cluster if: ${{ always() }} run: | @@ -274,6 +279,8 @@ jobs: test_helm_chart_in_airgapped_env: name: Test helm chart In An Airgapped Env. runs-on: [default] + env: + OFFLINE_IMAGE: "conformance/offline:latest" steps: - name: Checkout code uses: actions/checkout@v2 @@ -329,7 +336,7 @@ jobs: # wget --auth-no-challenge --header='Accept:application/octet-stream' https://$GITHUB_TOKEN:@api.github.com/repos/cncf/cnf-testsuite/releases/assets/38092818 -O airgapped.tar.gz cp -a $(pwd) /shared/$DIR/cnf-testsuite cp /tmp/airgapped.tar.gz /shared/$DIR/ - docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t conformance/offline:latest /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./example-cnfs/coredns/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" + docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t $OFFLINE_IMAGE /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./example-cnfs/coredns/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" - name: Delete Cluster if: ${{ always() }} run: | @@ -344,6 +351,8 @@ jobs: test_helm_directory_in_airgapped_env: name: Test helm directory In An Airgapped Env. runs-on: [default] + env: + OFFLINE_IMAGE: "conformance/offline:latest" steps: - name: Checkout code uses: actions/checkout@v2 @@ -397,7 +406,7 @@ jobs: #DOTO Use pre-created airgapped.tar.gz cp -a $(pwd) /shared/$DIR/cnf-testsuite cp /tmp/airgapped.tar.gz /shared/$DIR/ - docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t conformance/offline:latest /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./sample-cnfs/sample_coredns/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" + docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t $OFFLINE_IMAGE /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./sample-cnfs/sample_coredns/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" - name: Delete Cluster if: ${{ always() }} run: | @@ -412,6 +421,8 @@ jobs: test_manifest_directory_in_airgapped_env: name: Test manifest directory In An Airgapped Env. runs-on: [default] + env: + OFFLINE_IMAGE: "conformance/offline:latest" steps: - name: Checkout code uses: actions/checkout@v2 @@ -466,7 +477,7 @@ jobs: #DOTO Use pre-created airgapped.tar.gz cp -a $(pwd) /shared/$DIR/cnf-testsuite cp /tmp/airgapped.tar.gz /shared/$DIR/ - docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t conformance/offline:latest /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./sample-cnfs/k8s-non-helm/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" + docker run --name $DIR --network none --privileged -v /shared/$DIR/cnf-testsuite:/cnf-testsuite -v /shared/$DIR/airgapped.tar.gz:/airgapped/airgapped.tar.gz -v /shared/$DIR/tmpdata:/tmp -t $OFFLINE_IMAGE /bin/bash -c "LOG_LEVEL=info crystal src/cnf-testsuite.cr cnf_setup cnf-config=./sample-cnfs/k8s-non-helm/cnf-testsuite.yml input-file=/airgapped/airgapped.tar.gz; LOG_LEVEL=info crystal src/cnf-testsuite.cr all offline=true ~reasonable_startup_time ~reasonable_image_size ~pod_network_latency ~chaos_network_loss ~chaos_cpu_hog ~chaos_container_kill ~disk_fill ~platform ~volume_hostpath_not_found ~privileged ~increase_capacity ~decrease_capacity ~install_script_helm ~helm_chart_valid ~helm_chart_published verbose" - name: Delete Cluster if: ${{ always() }} run: | diff --git a/tools/airgapped_kind/Dockerfile b/tools/airgapped_kind/Dockerfile index f2cd32439..bd5792753 100644 --- a/tools/airgapped_kind/Dockerfile +++ b/tools/airgapped_kind/Dockerfile @@ -1,4 +1,4 @@ -FROM conformance/crystal:0.35.1-llvm10-grep +FROM conformance/crystal:1.0.0-alpine-r1 RUN apk add --no-cache \ ca-certificates \ diff --git a/tools/crystal-alpine.dockerfile b/tools/crystal-alpine.dockerfile new file mode 100644 index 000000000..472d6703b --- /dev/null +++ b/tools/crystal-alpine.dockerfile @@ -0,0 +1,11 @@ +FROM crystallang/crystal:1.0.0-alpine + +RUN apk add --update --no-cache --force-overwrite \ + gc-dev gcc gmp-dev libatomic_ops libevent-static \ + musl-dev pcre-dev yaml-static \ + libxml2-dev openssl-dev openssl-libs-static \ + tzdata yaml-dev zlib-static \ + make git \ + llvm10-dev llvm10-static g++ + +CMD ["/bin/sh"]