diff --git a/.github/workflows/CI-integrationtests.yml b/.github/workflows/CI-integrationtests.yml deleted file mode 100644 index 339cd7e..0000000 --- a/.github/workflows/CI-integrationtests.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: CI-integrationtests -# Execute integration tests for docker container -# with gammasim-tools - -on: - push: - tags: - - 'v*' - pull_request: - branches: ["main"] - release: - types: [published] - -jobs: - - integrationtests: - runs-on: ubuntu-latest - - strategy: - matrix: - # python-version: [3.8, 3.9, 3.10.4] - python-version: [3.9] - - steps: - - name: checkout - uses: actions/checkout@v3 - - - name: corsikasimtelpackage - run: | - wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets.CLOUD_SIMTEL }}/download - mv download ./dev/corsika7.7_simtelarray.tar.gz - - - name: build - run: | - cd ./dev - docker build -t gammasim-tools-dev . - - - name: unittest - run: | - cd dev/external - git clone https://github.com/gammasim/gammasim-tools.git - cd gammasim-tools - touch set_DB_environ.sh - echo "export DB_API_USER=${{ secrets.DB_API_USER }}" >> set_DB_environ.sh - echo "export DB_API_PW=${{ secrets.DB_API_PW }}" >> set_DB_environ.sh - echo "export DB_API_PORT=${{ secrets.DB_API_PORT }}" >> set_DB_environ.sh - echo "export DB_SERVER=${{ secrets.DB_SERVER }}" >> set_DB_environ.sh - cd ../.. - # run unit tests and require that all tests are pass - docker run -t --rm -v "$(pwd)/external:/workdir/external" gammasim-tools-dev bash -c "$(cat ./entrypoint.sh) && pytest -x tests/unit_tests/" | tee -a unit_tests.log - # run integration tests and require that all tests are pass - docker run -t --rm -v "$(pwd)/external:/workdir/external" gammasim-tools-dev bash -c "$(cat ./entrypoint.sh) && pytest -x tests/integration_tests/" | tee -a integration_tests.log - # cat unit_tests.log - # cat integration_tests.log diff --git a/.github/workflows/gammasim-tools-dev.yml b/.github/workflows/gammasim-tools-dev.yml deleted file mode 100644 index 5c1f7be..0000000 --- a/.github/workflows/gammasim-tools-dev.yml +++ /dev/null @@ -1,58 +0,0 @@ -# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images -name: docker-gammasim-tools-dev - -on: - push: - tags: - - 'v*' - pull_request: - branches: ["main"] - release: - types: [published] - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-gammasim-tools-dev: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - path: 'containers' - - - name: corsikasimtelpackage - run: | - wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets.CLOUD_SIMTEL }}/download - mv download corsika7.7_simtelarray.tar.gz - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - tags: | - type=ref,event=pr,suffix=-gammasim-tools-dev - type=semver,pattern={{major}}.{{minor}}.{{patch}},suffix=-gammasim-tools-dev - images: ${{ env.REGISTRY }}/gammasim-tools-dev/${{ env.IMAGE_NAME }} - - - name: Build and push Docker image - uses: docker/build-push-action@v3 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - file: ./containers/dev/Dockerfile - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }}-gammasim-tools-dev diff --git a/.github/workflows/simtelarray.yml b/.github/workflows/test-arch.yml similarity index 65% rename from .github/workflows/simtelarray.yml rename to .github/workflows/test-arch.yml index e49eb2f..6de6290 100644 --- a/.github/workflows/simtelarray.yml +++ b/.github/workflows/test-arch.yml @@ -1,5 +1,5 @@ # https://docs.github.com/en/actions/publishing-packages/publishing-docker-images -name: docker-simtelarray +name: docker-test-arch on: push: @@ -15,7 +15,7 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - build-simtelarray: + build-test-arch: runs-on: ubuntu-latest permissions: contents: read @@ -27,10 +27,11 @@ jobs: with: path: 'containers' - - name: corsikasimtelpackage - run: | - wget --no-verbose https://syncandshare.desy.de/index.php/s/${{ secrets.CLOUD_SIMTEL }}/download - mv download corsika7.7_simtelarray.tar.gz + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 - name: Log in to the Container registry uses: docker/login-action@v2 @@ -44,15 +45,16 @@ jobs: uses: docker/metadata-action@v4 with: tags: | - type=ref,event=pr,suffix=-simtelarray - type=semver,pattern={{major}}.{{minor}}.{{patch}},suffix=-simtelarray - images: ${{ env.REGISTRY }}/simtelarray/${{ env.IMAGE_NAME }} + type=ref,event=pr,suffix=-test-arch + type=semver,pattern={{major}}.{{minor}}.{{patch}},suffix=-test-arch + images: ${{ env.REGISTRY }}/gammasim/${{ env.IMAGE_NAME }} - name: Build and push Docker image uses: docker/build-push-action@v3 with: context: . - push: ${{ github.event_name != 'pull_request' }} - file: ./containers/simtelarray/Dockerfile + platforms: linux/amd64,linux/arm64/v8 + push: ${{ github.event_name != 'release' }} + file: ./containers/test-arch/Dockerfile tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }}-simtelarray + labels: ${{ steps.meta.outputs.labels }}-test-arch diff --git a/test-arch/Dockerfile b/test-arch/Dockerfile new file mode 100644 index 0000000..4e4f672 --- /dev/null +++ b/test-arch/Dockerfile @@ -0,0 +1,25 @@ +From ubuntu:22.10 as build_image +WORKDIR /workdir +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y \ + bash \ + build-essential \ + bzip2 \ + csh \ + git \ + libgsl-dev \ + unzip \ + vim \ + wget && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN uname -a + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-$(uname -p).sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /workdir/conda && \ + rm ~/miniconda.sh && \ + /workdir/conda/bin/conda clean -tipy && \ + /workdir/conda/bin/conda install -c conda-forge mamba + +WORKDIR /workdir/external