Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Build and push to Quay (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet89 committed Dec 4, 2020
1 parent 5ad0ec4 commit 7ad105a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 17 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/fastapi-gunicorn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and test fastapi-gunicorn

on:
push:
branches:
- master
# Matching semver tags: v3.8.2, etc.
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -41,14 +43,40 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Tag and push image
uses: docker/build-push-action@v1.1.0
env:
DOCKER_BUILDKIT: 1
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: quay.io/basisai/express-fastapi
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Quay
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: basisai/fastapi-gunicorn
build_args: APP=fastapi-gunicorn
tags: fastapi-gunicorn
tag_with_ref: true
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
APP=fastapi-gunicorn
# platforms: linux/amd64,linux/arm64,linux/386
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
45 changes: 37 additions & 8 deletions .github/workflows/flask-gunicorn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and test flask-gunicorn

on:
push:
branches:
- master
# Matching semver tags: v3.8.2, etc.
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
Expand Down Expand Up @@ -41,14 +43,41 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Tag and push image
uses: docker/build-push-action@v1.1.0
env:
DOCKER_BUILDKIT: 1
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: quay.io/basisai/express-flask
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Quay
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: basisai/flask-gunicorn
build_args: APP=flask-gunicorn
tags: flask-gunicorn
tag_with_ref: true
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
build-args: |
APP=flask-gunicorn
# platforms: linux/amd64,linux/arm64,linux/386
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ serve {
}
```

The [basisai/express-flask](https://hub.docker.com/r/basisai/express-flask) image is hosted on docker hub and should be accessible from your workload environment on Bedrock. You may change it to any other supported image, such as [basisai/express-fastapi](https://hub.docker.com/r/basisai/express-fastapi).
The [quay.io/basisai/express-flask](https://quay.io/basisai/express-flask) image is hosted on Quay
and should be accessible from your workload environment on Bedrock. You may change it to any other
supported image, such as [quay.io/basisai/express-fastapi](https://quay.io/basisai/express-fastapi).

The `install` stanza specifies how to install additional dependencies that your server might need, eg. torchvision or tensorflow. Most valid bash commands will work.

Expand Down

0 comments on commit 7ad105a

Please sign in to comment.