Unverified Commit 144ae446 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #2360 from nd-02110114/fix-docker-setting

Fix automate docker release process
parents 37ed5787 e8b8daf4
Loading
Loading
Loading
Loading
+34 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ jobs:
      with:
        file: ./coverage.xml

  deploy:
  pypi-build:
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    needs: [build]
    runs-on: ubuntu-latest
@@ -166,3 +166,36 @@ jobs:
      run: |
        python setup.py sdist bdist_wheel
        twine upload dist/*

  docker-build:
    if: github.event_name == 'push' && github.ref == 'refs/heads/master'
    needs: [build, pypi-build]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Docker Buildx
      id: buildx
      uses: docker/setup-buildx-action@master
    - 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 DockerHub
      uses: docker/login-action@v1 
      with:
        username: ${{ secrets.DOCKER_HUB_USERNAME }}
        password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
    - name: Build and push
      id: docker_build
      uses: docker/build-push-action@v2
      with:
        builder: ${{ steps.buildx.outputs.name }}
        context: ./docker/nightly
        push: true
        tags: deepchemio/deepchem:latest
        cache-from: type=local,src=/tmp/.buildx-cache
        cache-to: type=local,dest=/tmp/.buildx-cache
    - name: Image digest
      run: echo ${{ steps.docker_build.outputs.digest }}
+25 −3
Original line number Diff line number Diff line
name: Release PyPI packages
name: Release
on:
  push:
    tags:
      - '*' # ci work when pushing a tag
jobs:
  release:
  pypi:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python-version: [3.7]
    steps:
@@ -41,3 +40,26 @@ jobs:
      run: |
        python setup.py sdist bdist_wheel --release
        twine upload dist/*

  docker:
    needs: [pypi]
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Get the tag version
      id: get_tag_version
      run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
    - name: Login to DockerHub
      uses: docker/login-action@v1 
      with:
        username: ${{ secrets.DOCKER_HUB_USERNAME }}
        password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
    - name: Build and push
      id: docker_build
      uses: docker/build-push-action@v2
      with:
        context: ./docker/tag
        push: true
        tags: deepchemio/deepchem:${{ steps.get_tag_version.outputs.VERSION }}
    - name: Image digest
      run: echo ${{ steps.docker_build.outputs.digest }}
+2 −2
Original line number Diff line number Diff line
@@ -92,11 +92,11 @@ DockerHub : https://hub.docker.com/repository/docker/deepchemio/deepchem
- `deepchemio/deepchem:x.x.x`
  - Image built by using a conda (x.x.x is a version of deepchem)
  - The x.x.x image is built when we push x.x.x. tag
  - Dockerfile is put in `docker/conda-forge` directory
  - Dockerfile is put in `docker/tag` directory
- `deepchemio/deepchem:latest`
  - Image built from source codes
  - The latest image is built every time we commit to the master branch
  - Dockerfile is put in `docker/master` directory
  - Dockerfile is put in `docker/nightly` directory

You pull the image like this.

+0 −0

File moved.

+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ RUN conda update -n base conda && \
    conda create -y --name deepchem python=3.6 && \
    . /miniconda/etc/profile.d/conda.sh && \
    conda activate deepchem && \
    pip install tensorflow==2.3.* && \
    conda install -c conda-forge rdkit deepchem==2.4.0 && \
    pip install tensorflow==2.3.* deepchem && \
    conda install -c conda-forge rdkit && \
    conda clean -afy && \
    rm -rf ~/.cache/pip

Loading