mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-24 09:04:19 +01:00
🐋 feat: docker base image
This commit is contained in:
34
.github/workflows/push-docker-base-image.yml
vendored
34
.github/workflows/push-docker-base-image.yml
vendored
@@ -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
|
||||
@@ -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'
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user