From 041072761024a580382614f4ee4f4b78ad8abddd Mon Sep 17 00:00:00 2001 From: Marie Salm Date: Fri, 1 Dec 2023 14:00:33 +0100 Subject: [PATCH] support ARM --- .github/workflows/dockerhub.yml | 36 ++++++++++++++++----------------- Dockerfile | 2 +- app/tasks.py | 1 - 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 0bbb640..af529cd 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -14,32 +14,32 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/*/} | sed -e 's?/?-?g') + uses: docker/setup-qemu-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: planqk/pytket-service + tags: | + # set latest tag for main branch + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} + # set tag when a tag is pushed + type=ref,event=tag - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Build and push latest pytket-service - if: ${{ steps.vars.outputs.tag == 'main' }} - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: planqk/pytket-service:latest - - - name: Build and push version of pytket-service - if: ${{ steps.vars.outputs.tag != 'main' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . + platforms: linux/amd64,linux/arm64 push: true - tags: planqk/pytket-service:${{ steps.vars.outputs.tag }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 7e29b6a..5d86b60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM python:3.9-slim MAINTAINER Marie Salm "marie.salm@iaas.uni-stuttgart.de" -COPY ./requirements.txt /app/requirements.txt WORKDIR /app RUN apt-get update RUN apt-get install -y gcc python3-dev +COPY ./requirements.txt /app/requirements.txt RUN pip install -r requirements.txt COPY . /app diff --git a/app/tasks.py b/app/tasks.py index 96aaed8..ef15218 100644 --- a/app/tasks.py +++ b/app/tasks.py @@ -83,7 +83,6 @@ def execute(impl_url, impl_data, transpiled_qasm, transpiled_quil, input_params, short_impl_name=short_impl_name, logger=None, precompile_circuit=True) finally: - # Take circuit out of tuple returned by transpile if not backend.valid_circuit(circuit): result = Result.query.get(job.get_id()) result.result = json.dumps({'error': 'execution failed'})