Skip to content

Commit

Permalink
docker,ci: add persistent caching
Browse files Browse the repository at this point in the history
Signed-off-by: Ernesto Puerta <[email protected]>
  • Loading branch information
epuertat committed Jan 23, 2024
1 parent b6d3040 commit ca135a9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# yamllint disable rule:line-length
# yamllint disable rule:comments
name: "CI"
on: # yamllint disable rule:truthy
push:
Expand All @@ -20,6 +21,7 @@ concurrency:
cancel-in-progress: true
env:
WAIT_INTERVAL_SECS: 1
DOCKER_COMPOSE: docker compose
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -29,6 +31,9 @@ jobs:
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build container images - spdk
run: make build SVC="spdk" SPDK_TARGET_ARCH=x86-64-v2

Expand All @@ -41,9 +46,6 @@ jobs:
- name: Build container images - nvmeof-cli
run: make build SVC="nvmeof-cli" SPDK_TARGET_ARCH=x86-64-v2

- name: Build container images - discovery
run: make build SVC="discovery" SPDK_TARGET_ARCH=x86-64-v2

- name: Save container images
run: |
. .env
Expand All @@ -63,9 +65,18 @@ jobs:
build-ceph:
runs-on: ubuntu-latest
steps:
- name: Info
run: |
docker --version
docker compose version
docker info
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build container images - ceph
run: make build SVC=ceph

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ build: export NVMEOF_GIT_MODIFIED_FILES != git status -s | grep -e "^ *M" | sed
up: ## Launch services
up: SVC ?= ceph nvmeof ## Services
up: OPTS ?= --abort-on-container-exit --exit-code-from $(SVC) --remove-orphans
#up: override OPTS += --scale nvmeof=$(SCALE)

clean: $(CLEAN) setup ## Clean-up environment
clean: override HUGEPAGES = 0
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
# yamllint disable rule:line-length
# yamllint disable rule:comments
version: "3.8"
services:
spdk:
Expand Down Expand Up @@ -26,6 +29,10 @@ services:
SPDK_GIT_COMMIT:
labels:
io.ceph.nvmeof:
cache_from:
- type=gha
cache_to:
- type=gha
# Used to export RPM packages externally (via bind mount)
spdk-rpm-export:
extends:
Expand Down Expand Up @@ -61,6 +68,10 @@ services:
CEPH_CLUSTER_CEPH_REPO_BASEURL:
labels:
io.ceph.nvmeof:
cache_from:
- type=gha
cache_to:
- type=gha
environment:
TOUCHFILE: /tmp/ceph.touch
entrypoint: >-
Expand Down Expand Up @@ -121,6 +132,10 @@ services:
HUGEPAGES_DIR:
labels:
io.ceph.nvmeof:
cache_from:
- type=gha
cache_to:
- type=gha
volumes:
# sudo bash -c 'echo 2048 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages'
# https://spdk.io/doc/containers.html
Expand Down
1 change: 0 additions & 1 deletion mk/containerized.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ DOCKER_COMPOSE_COMMANDS = pull build up run exec ps top images logs port \
pause unpause stop restart down events

OPTS ?= ## Docker-compose subcommand options
SCALE ?= 1 ## Number of instances
CMD ?= ## Command to run with run/exec targets

.PHONY: $(DOCKER_COMPOSE_COMMANDS) shell
Expand Down

0 comments on commit ca135a9

Please sign in to comment.