Skip to content

Commit

Permalink
support ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
salmma committed Dec 1, 2023
1 parent ba9060d commit 0410727
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM python:3.9-slim

MAINTAINER Marie Salm "[email protected]"

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

Expand Down
1 change: 0 additions & 1 deletion app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'})
Expand Down

0 comments on commit 0410727

Please sign in to comment.