🐋 feat: docker base image

This commit is contained in:
Florian Hönicke
2023-05-04 11:00:16 +02:00
parent 87e5e6a99d
commit e44459e13f
2 changed files with 36 additions and 1 deletions

View File

@@ -13,18 +13,50 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check if code relevant to executor has changed
uses: dorny/paths-filter@v2
id: check
with:
filters: |
changed:
- src/options/generate/static_files/base_image/**
- name: Get base image tag
if: steps.check.outputs.changed == 'true'
shell: bash
run: |
FILE='scr/constants.py'
VERSION=$(sed -n '/DOCKER_BASE_IMAGE_VERSION =/p' $FILE | cut -d \' -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check that tag isn't used already for the docker base image
if: steps.check.outputs.changed == 'true'
env:
VERSION: ${{ env.VERSION }}
shell: bash
run: |
if jina hub pull jinahub+docker://jinaai/gpt-dev/$VERSION; then
echo "Executor version/tag is used already. Please update the tag"
exit 1
else
echo "Executor version/tag isn't used already, continue to build..."
fi
- name: Set up Docker Buildx
if: steps.check.outputs.changed == 'true'
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
if: steps.check.outputs.changed == 'true'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DEVBOT_USER }}
password: ${{ secrets.DOCKERHUB_DEVBOT_PWD }}
- name: Build and Push Docker Image
if: steps.check.outputs.changed == 'true'
uses: docker/build-push-action@v2
with:
context: src/options/generate/static_files/base_image
push: true
tags: jinaai/gpt-dev:latest
tags: jinaai/gpt-dev:$VERSION

View File

@@ -1,3 +1,5 @@
DOCKER_BASE_IMAGE_VERSION = '0.0.1'
EXECUTOR_FILE_NAME = '__init__.py'
IMPLEMENTATION_FILE_NAME = 'microservice.py'
TEST_EXECUTOR_FILE_NAME = 'test_microservice.py'
@@ -51,3 +53,4 @@ LANGUAGE_PACKAGES = [
'pattern', 'polyglot', 'pytorch-transformers', 'rasa', 'sentence-transformers',
'spacy', 'stanza', 'summarizer', 'sumy', 'textblob', 'textstat', 'transformers'
]