未验证 提交 3f818106 编写于 作者: Q quicksilver 提交者: GitHub

Cache dependencies to speed up GitHub Action workflows (#3501)

* Cache dependencies to speed up workflows
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>

* Cache dependencies to speed up workflows
Signed-off-by: Nquicksilver <zhifeng.zhang@zilliz.com>
上级 8f26e69f
...@@ -50,6 +50,12 @@ jobs: ...@@ -50,6 +50,12 @@ jobs:
run: | run: |
docker-compose build ubuntu-core docker-compose build ubuntu-core
docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0 docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0
- name: Cache Docker Volumes
uses: actions/cache@v1
with:
path: .docker
key: ubuntu${{ matrix.ubuntu }}-${{ hashFiles('core/**') }}
restore-keys: ubuntu${{ matrix.ubuntu }}-
- name: Docker Run - name: Docker Run
run: | run: |
docker-compose run ubuntu-core docker-compose run ubuntu-core
...@@ -96,6 +102,12 @@ jobs: ...@@ -96,6 +102,12 @@ jobs:
run: | run: |
docker-compose build centos-core docker-compose build centos-core
docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0 docker rmi $(docker images | grep '<none>' | awk '{print $3}') || exit 0
- name: Cache Docker Volumes
uses: actions/cache@v1
with:
path: .docker
key: centos${{ matrix.centos }}-${{ hashFiles('core/**') }}
restore-keys: centos${{ matrix.centos }}-
- name: Docker Run - name: Docker Run
run: | run: |
docker-compose run centos-core docker-compose run centos-core
......
version: '3.5' version: '3.5'
volumes:
amd64-ubuntu-18.04-cache:
amd64-centos-7-cache:
amd64-ubuntu-18.04-cuda-cache:
amd64-centos-7-cuda-cache:
x-ccache: &ccache x-ccache: &ccache
CCACHE_COMPILERCHECK: content CCACHE_COMPILERCHECK: content
CCACHE_COMPRESS: 1 CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 5 CCACHE_COMPRESSLEVEL: 5
CCACHE_MAXSIZE: 2G CCACHE_MAXSIZE: 2G
CCACHE_DIR: /build/ccache CCACHE_DIR: /ccache
services: services:
ubuntu-core: ubuntu-core:
...@@ -26,7 +20,7 @@ services: ...@@ -26,7 +20,7 @@ services:
<<: *ccache <<: *ccache
volumes: &ubuntu-volumes volumes: &ubuntu-volumes
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-ubuntu-${UBUNTU}-cache:/build:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-ubuntu-${UBUNTU}-cache:/ccache:delegated
networks: networks:
- milvus - milvus
command: &ubuntu-command command: &ubuntu-command
...@@ -45,7 +39,7 @@ services: ...@@ -45,7 +39,7 @@ services:
<<: *ccache <<: *ccache
volumes: &centos-volumes volumes: &centos-volumes
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-centos-${CENTOS}-cache:/ccache:delegated
networks: networks:
- milvus - milvus
command: &centos-command command: &centos-command
...@@ -64,7 +58,7 @@ services: ...@@ -64,7 +58,7 @@ services:
<<: *ccache <<: *ccache
volumes: &ubuntu-cuda-volumes volumes: &ubuntu-cuda-volumes
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-ubuntu-${UBUNTU}-cuda-cache:/build:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-ubuntu-${UBUNTU}-cuda-cache:/ccache:delegated
networks: networks:
- milvus - milvus
command: &ubuntu-cuda-command command: &ubuntu-cuda-command
...@@ -82,7 +76,7 @@ services: ...@@ -82,7 +76,7 @@ services:
<<: *ccache <<: *ccache
volumes: &centos-cuda-volumes volumes: &centos-cuda-volumes
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cuda-cache:/build:delegated - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-centos-${CENTOS}-cuda-cache:/ccache:delegated
networks: networks:
- milvus - milvus
command: &centos-cuda-command command: &centos-cuda-command
...@@ -98,7 +92,6 @@ services: ...@@ -98,7 +92,6 @@ services:
shm_size: 2G shm_size: 2G
volumes: volumes:
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cache:/build:delegated
networks: networks:
- milvus - milvus
command: command:
...@@ -114,7 +107,6 @@ services: ...@@ -114,7 +107,6 @@ services:
shm_size: 2G shm_size: 2G
volumes: volumes:
- .:/milvus:delegated - .:/milvus:delegated
- ${ARCH}-centos-${CENTOS}-cuda-cache:/build:delegated
networks: networks:
- milvus - milvus
command: command:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册