From 9019453bbc332bc26f6561bb12c72066b4ba10a2 Mon Sep 17 00:00:00 2001 From: dev-rinchin Date: Mon, 28 Mar 2022 14:18:51 +0000 Subject: [PATCH 1/4] init docker workflow --- .github/workflows/docker.yml | 31 +++++++++++++++++++++++++++++++ Dockerfile | 15 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/docker.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..161b31f --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,31 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + # tags: [ 'v*.*.*' ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/lightautoml:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..56c553c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:latest + +RUN apt-get update + +RUN apt install -y python3-dev python3-pip curl git + +RUN git clone https://github.com/sberbank-ai-lab/LightAutoML.git +WORKDIR /LightAutoML/ + +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - +ENV PATH="${PATH}:/root/.poetry/bin" + +RUN poetry -V +RUN poetry config virtualenvs.create false --local +RUN poetry install From c83b66e5b78e44df21b6e1322c71db5b38e74b6e Mon Sep 17 00:00:00 2001 From: Rinchin <57899558+dev-rinchin@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:31:38 +0300 Subject: [PATCH 2/4] Update docker.yml --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 161b31f..3542641 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: Docker Image CI on: push: - branches: [ master ] + branches: [ master, feature/publishing-docker-images] # tags: [ 'v*.*.*' ] jobs: From 2f65b544a635fdb16512aeaeee4ad021a1200b59 Mon Sep 17 00:00:00 2001 From: dev-rinchin Date: Tue, 29 Mar 2022 09:11:32 +0000 Subject: [PATCH 3/4] set docker workflow with release trigger --- .github/workflows/docker.yml | 13 ++++++++----- Dockerfile | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3542641..8e65a3a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,16 +1,15 @@ -name: Docker Image CI +name: Build and push Docker image to the DockerHub on: - push: - branches: [ master, feature/publishing-docker-images] - # tags: [ 'v*.*.*' ] + release: + types: [published, edited] jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout uses: actions/checkout@v2 - name: Login to Docker Hub @@ -29,3 +28,7 @@ jobs: file: ./Dockerfile push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/lightautoml:latest + tag_with_sha: true + tag_with_ref: true + cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:buildcache + cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:buildcache,mode=max \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 56c553c..9ccb213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,9 @@ RUN apt install -y python3-dev python3-pip curl git RUN git clone https://github.com/sberbank-ai-lab/LightAutoML.git WORKDIR /LightAutoML/ -RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - ENV PATH="${PATH}:/root/.poetry/bin" RUN poetry -V -RUN poetry config virtualenvs.create false --local +RUN poetry config virtualenvs.create false --local RUN poetry install From 8763385b26a6d00a15410b5fe26106e64ad70f32 Mon Sep 17 00:00:00 2001 From: Rinchin <57899558+dev-rinchin@users.noreply.github.com> Date: Tue, 29 Mar 2022 12:33:15 +0300 Subject: [PATCH 4/4] Update docker.yml --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8e65a3a..e55a4b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: Build and push Docker image to the DockerHub +name: Build and push Docker image to the DockerHub on: release: @@ -29,6 +29,6 @@ jobs: push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/lightautoml:latest tag_with_sha: true - tag_with_ref: true + tag_with_ref: true cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:buildcache - cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:buildcache,mode=max \ No newline at end of file + cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:buildcache,mode=max