Skip to content

Commit

Permalink
Merge branch 'IDX-2604-bazel-icos-tmpfs' into 'master'
Browse files Browse the repository at this point in the history
improvement: [IDX-2604] tmpfs for podman's root

Changes that improve build performance of IC-OS images and even more, prevents occupying disk space for container images that are only used for building rootfs for IC-OS images. We have them cached on host machine under `/srv/cache/containers` (bind-mounted to `/var/lib/containers`). This cache is not valuable, bazel cache satisfies all concerns.

With this change `tmpfs` is created and mounted under `/tmp/tmpfs` and lives only during the lifetime of CI or `container-run.sh`'s container. Directory `/tmp/tmpfs/podman_root` is used for `podman`'s [root](https://docs.podman.io/en/latest/markdown/podman.1.html#root-value).

Using `tmpfs` for `/var/tmp/bazel-output` will be considered/added separately.

IDX-2604 

Closes IDX-2604

See merge request dfinity-lab/public/ic!13635
  • Loading branch information
marko-k0 committed Jul 19, 2023
2 parents 1a80ef5 + 75179b9 commit b790677
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
@@ -1,5 +1,5 @@
{
"image": "dfinity/ic-build:97c9c8be8665e272e9d7d9ae0312ee3f4860848d7a9c0421d68094f421f98cc7",
"image": "dfinity/ic-build:2640827df10ee10626121f53c7cb7c75b9014f5c2240c664579267bdba97a95b",
"remoteUser": "ubuntu",
"privileged": true,
"runArgs": [
Expand Down
4 changes: 2 additions & 2 deletions gitlab-ci/config/00--common.yml
Expand Up @@ -149,7 +149,7 @@ after_script:
artifacts:
expire_in: 3 days
image:
name: "registry.gitlab.com/dfinity-lab/core/docker/ic-build:97c9c8be8665e272e9d7d9ae0312ee3f4860848d7a9c0421d68094f421f98cc7"
name: "registry.gitlab.com/dfinity-lab/core/docker/ic-build:2640827df10ee10626121f53c7cb7c75b9014f5c2240c664579267bdba97a95b"
tags:
- dfinity-ic
variables:
Expand All @@ -159,7 +159,7 @@ after_script:
artifacts:
expire_in: 3 days
image:
name: "registry.gitlab.com/dfinity-lab/core/docker/ic-build-legacy:97c9c8be8665e272e9d7d9ae0312ee3f4860848d7a9c0421d68094f421f98cc7"
name: "registry.gitlab.com/dfinity-lab/core/docker/ic-build-legacy:2640827df10ee10626121f53c7cb7c75b9014f5c2240c664579267bdba97a95b"
tags:
- dfinity-ic
variables:
Expand Down
2 changes: 1 addition & 1 deletion gitlab-ci/container/TAG
@@ -1 +1 @@
97c9c8be8665e272e9d7d9ae0312ee3f4860848d7a9c0421d68094f421f98cc7
2640827df10ee10626121f53c7cb7c75b9014f5c2240c664579267bdba97a95b
8 changes: 7 additions & 1 deletion gitlab-ci/container/files/docker.sh
Expand Up @@ -5,5 +5,11 @@ set -e
if [ -e /var/run/docker.sock ]; then
docker-bin "$@"
else
sudo podman "$@"
# set podman's root on tmpfs
mkdir -p /tmp/tmpfs
if ! mount | grep -q tmp-tmpfs; then
sudo mount -t tmpfs tmp-tmpfs /tmp/tmpfs
fi

sudo podman --root /tmp/tmpfs/podman_root "$@"
fi

0 comments on commit b790677

Please sign in to comment.