forked from tinkoff-ai/etna
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: debug building docker image from poetry.lock
- Loading branch information
Showing
1 changed file
with
25 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,53 @@ | ||
name: Build and push docker image from trunk | ||
|
||
#on: | ||
# push: | ||
# branches: | ||
# - master | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
|
||
push: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
dockerfile: | ||
- {"name": etna-cpu, "path": docker/etna-cpu/Dockerfile} | ||
- {"name": etna-cuda-11.6.2, "path": docker/etna-cuda-11.6.2/Dockerfile} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
- name: Install dependencies | ||
run: | | ||
poetry install -E "all" -vv | ||
- name: Build image | ||
run: | | ||
cd $( dirname ${{ matrix.dockerfile.path }}) | ||
sed -i 's#etna\[all\]#etna[all] @ git+https://github.com/${{ github.repository }}.git@${{ github.sha }}#g' requirements.txt | ||
sed -i '/etna\[all\]/d' requirements.txt | ||
poetry export --without-hashes --format=requirements.txt > poetry_requirements.txt | ||
cat poetry_requirements.txt >> requirements.txt | ||
# sed -i 's#etna\[all\]#etna[all] @ git+https://github.com/${{ github.repository }}.git@${{ github.sha }}#g' requirements.txt | ||
cat requirements.txt | ||
docker build . --tag image | ||
- name: Log into registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.dockerfile.name }} | ||
VERSION=latest | ||
echo IMAGE_ID=$IMAGE_ID | ||
echo VERSION=$VERSION | ||
docker tag image $IMAGE_ID:$VERSION | ||
docker push $IMAGE_ID:$VERSION | ||
# docker tag image $IMAGE_ID:$VERSION | ||
# docker push $IMAGE_ID:$VERSION |