Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use estargz compression and add more tags #2

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

ben-z
Copy link
Member

@ben-z ben-z commented Aug 12, 2024

This is to see if we can run the image faster using https://github.com/containerd/stargz-snapshotter

@ben-z
Copy link
Member Author

ben-z commented Aug 12, 2024

Ran some very crude speed tests comparing gzip and zstd:

  • pull :main
  • pull :pr-2
  • pull :main with registry-proxy cache (cache is prewarmed)
  • pull :pr-2 with registry-proxy cache (cache is prewarmed)
ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image:main'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

main: Pulling from watonomous/actions-runner-image
9b857f539cb1: Pull complete
5ca6a32100f1: Pull complete
1ab3e60ed28e: Pull complete
f315f7a81109: Pull complete
36f7a483b818: Pull complete
4f4fb700ef54: Pull complete
c02ba868b699: Pull complete
1698891c9a2f: Pull complete
82f90b9e4e0f: Pull complete
213d2aae0b35: Pull complete
d0db0224b27c: Pull complete
02e8b1756429: Pull complete
5ac15d953d36: Pull complete
ac67bf68d39d: Pull complete
Digest: sha256:51c98264f4121e672b9cf93d0802925a3d477c49fd2a84350c5ff99b00edef74
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image:main
ghcr.io/watonomous/actions-runner-image:main
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.02s system 0% cpu 25.481 total
ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image:pr-2'   25s
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

pr-2: Pulling from watonomous/actions-runner-image
2c905b3ecf9a: Pull complete
5063b1842682: Pull complete
a7e7060fee6f: Pull complete
5be391aa44b5: Pull complete
c074fc5fb133: Pull complete
4f4fb700ef54: Pull complete
da0398703a9b: Pull complete
36577d35625e: Pull complete
96b234d780d7: Pull complete
967af94ff292: Pull complete
b635361444a4: Pull complete
bede954791f3: Pull complete
e755b77e6053: Pull complete
aa789e5b1fe2: Pull complete
Digest: sha256:bd3668d2180fc04fee55beb18af8c962ba56377b7a5809ba532adaaa3d93efe9
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image:pr-2
ghcr.io/watonomous/actions-runner-image:pr-2
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.02s system 0% cpu 24.826 total
ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image:main'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

main: Pulling from watonomous/actions-runner-image
9b857f539cb1: Pull complete
5ca6a32100f1: Pull complete
1ab3e60ed28e: Pull complete
f315f7a81109: Pull complete
36f7a483b818: Pull complete
4f4fb700ef54: Pull complete
c02ba868b699: Pull complete
1698891c9a2f: Pull complete
82f90b9e4e0f: Pull complete
213d2aae0b35: Pull complete
d0db0224b27c: Pull complete
02e8b1756429: Pull complete
5ac15d953d36: Pull complete
ac67bf68d39d: Pull complete
Digest: sha256:51c98264f4121e672b9cf93d0802925a3d477c49fd2a84350c5ff99b00edef74
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image:main
ghcr.io/watonomous/actions-runner-image:main
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 32.139 total
ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image:pr-2'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

pr-2: Pulling from watonomous/actions-runner-image
2c905b3ecf9a: Pull complete
5063b1842682: Pull complete
a7e7060fee6f: Pull complete
5be391aa44b5: Pull complete
c074fc5fb133: Pull complete
4f4fb700ef54: Pull complete
da0398703a9b: Pull complete
36577d35625e: Pull complete
96b234d780d7: Pull complete
967af94ff292: Pull complete
b635361444a4: Pull complete
bede954791f3: Pull complete
e755b77e6053: Pull complete
aa789e5b1fe2: Pull complete
Digest: sha256:bd3668d2180fc04fee55beb18af8c962ba56377b7a5809ba532adaaa3d93efe9
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image:pr-2
ghcr.io/watonomous/actions-runner-image:pr-2
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 31.688 total

Summary: proxied requests are slightly slower. There seems to be little difference between zstd compression and default compression. The latter is perhaps due to that a large part of this image the upstream ghcr.io/actions/actions-runner (moby/buildkit#2057). EDIT: the compression=zstd option still uses gzip for some reason. EDIT: it turns out I need to initialize buildx for this to work.

Uncompressed:

> docker manifest inspect ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
{
	"schemaVersion": 2,
	"mediaType": "application/vnd.oci.image.manifest.v1+json",
	"config": {
		"mediaType": "application/vnd.oci.image.config.v1+json",
		"digest": "sha256:221cac2606e4f382b1d710c26a9bd16bd36ae634f44d2776caf8e047e33dcdc2",
		"size": 9192
	},
	"layers": [
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:2a26336a42c7c8c9b1708f77751d44b4762c0124806666c3b0fe076b4e4f44ad",
			"size": 80412672
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:791992b420bfd6bd620be0ef58464e384dc8bef501be98d9f22f6e2d72a82efa",
			"size": 38589952
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:1b58bbb8778777805a8de1b153663d05763bbb7a7caf846ec20aefa06109d9cb",
			"size": 87034368
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:982557af76dd588e1581a19d533e3321247b17b5d822a52b0448a82e67112827",
			"size": 56632320
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:a92b8f6a44d11c8c2818ab46a095ce60cf0cbeb1e6a578acb50f21ce73121ebb",
			"size": 353280
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
			"size": 1024
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:dd6a69b8563f35f3ff6214e2fd81e3f645949fe3c7759f9fe5fd44bb0f8eff66",
			"size": 768351232
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:33f6ca0d268312a8bafe3ad99d34b5c9a737d1c10d5a62324707901153b00be5",
			"size": 57045504
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:37584b9a1e75299b28ce9ff47394955774e87a690e2df044bf91695cde9b94ae",
			"size": 198814208
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:a9ea8a09f0cdb3c9f49feafa38f382f78a5d8a222c8f41892f9da23a38dad943",
			"size": 334657536
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:584ff94048f5947a83d5f39186195530e41ebceb7db164e46bbee855792029e9",
			"size": 71939072
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:8fbaeb6d06cdc9742d8495a43e16dda5a06f715eb83edcbd53bd10c3538316c3",
			"size": 59633152
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:25f0eb003cad080c3a185630eb95cc476983587770a3f46239fb3aaa2ef85119",
			"size": 11905536
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar",
			"digest": "sha256:8cdd57217c99cc0f96b4c88068449f250723c694f42364bfd2e15b2da6eb6415",
			"size": 2072064
		}
	]
}

zstd:

> docker manifest inspect ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
{
	"schemaVersion": 2,
	"mediaType": "application/vnd.oci.image.manifest.v1+json",
	"config": {
		"mediaType": "application/vnd.oci.image.config.v1+json",
		"digest": "sha256:7de2fa04b292d82634f4b9de007dcbf4845f7b4208cfcaccfda5cead8b9513c0",
		"size": 9196
	},
	"layers": [
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:c7de327890c7db497991b5d40279ca56ea03c5747fa4c9c24bc97e0302061255",
			"size": 27139976
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:fd0cc26627dc1a3d52756fbd0b93bb2d68b634d3a18e0e7e0c09efcde93d8bff",
			"size": 14348695
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:fe803e696e73c7560bff029c7e004ad5044b1bacc10bd02a7c50887f18b95c71",
			"size": 28137930
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:e034240e93b835df0ab871c3d4154a0d763094b6ef5f12cfce1d417e18865d8a",
			"size": 37511682
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:4bbafbe376e8c1b0fec62f06fb474c2cb4c9ee547a364be49f841d9835c7531d",
			"size": 3948
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:2c1ce468d9f3d941396801f6e3afc8921466650dd05430fe644cd3537713d27f",
			"size": 16
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:60311e4cb18603f67e089d1844e0892474ac2394dc4a79b3b6761be7d15da829",
			"size": 256532106
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:737fbe2f62b3ece4a6fe90dedb733cde3e85a04949a13998f14c7dcbecd6b4f4",
			"size": 17252258
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:f8c9b9f6fc3700f5d4f91441f56e9fd2c79715734122c147315f626fbb3da9f3",
			"size": 73938215
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:c5c2025aeb0185acfe72c2db9d47f531f7f55d05a351e58de099669d9973a82a",
			"size": 113607507
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:cbfea2686041c51d63a21d2de1ffa45726880d0c787c4f8147ab3a8137d58942",
			"size": 46245741
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:c5c05e90d28564e2bd8f8046add4ccbdb4e92877cf3693a888cf51ea8678f45a",
			"size": 16839865
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:2f942f92030d8ee23f657270e12d3d8ef89ecd2489047f680b05b870285eebe7",
			"size": 5335046
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+zstd",
			"digest": "sha256:b4b88e6e1442cdb2bbabe21e766f0204ebc724c6f7c933cd7aa326293410a82c",
			"size": 976076
		}
	]
}

@ben-z
Copy link
Member Author

ben-z commented Aug 12, 2024

After fixing the image compression (previously the compression didn't take effect). I reran the experiments with (uncompressed no proxy, uncompressed with prewarmed proxy, zstd no proxy, zstd with prewarmed proxy):

ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7: Pulling from watonomous/actions-runner-image
2a26336a42c7: Pull complete
791992b420bf: Pull complete
1b58bbb87787: Pull complete
982557af76dd: Pull complete
a92b8f6a44d1: Pull complete
5f70bf18a086: Pull complete
dd6a69b8563f: Pull complete
33f6ca0d2683: Pull complete
37584b9a1e75: Pull complete
a9ea8a09f0cd: Pull complete
584ff94048f5: Pull complete
8fbaeb6d06cd: Pull complete
25f0eb003cad: Pull complete
8cdd57217c99: Pull complete
Digest: sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.02s user 0.02s system 0% cpu 35.058 total

ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7: Pulling from watonomous/actions-runner-image
2a26336a42c7: Pull complete
791992b420bf: Pull complete
1b58bbb87787: Pull complete
982557af76dd: Pull complete
a92b8f6a44d1: Pull complete
5f70bf18a086: Pull complete
dd6a69b8563f: Pull complete
33f6ca0d2683: Pull complete
37584b9a1e75: Pull complete
a9ea8a09f0cd: Pull complete
584ff94048f5: Pull complete
8fbaeb6d06cd: Pull complete
25f0eb003cad: Pull complete
8cdd57217c99: Pull complete
Digest: sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 33.938 total

ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558: Pulling from watonomous/actions-runner-image
c7de327890c7: Pull complete
fd0cc26627dc: Pull complete
fe803e696e73: Pull complete
e034240e93b8: Pull complete
4bbafbe376e8: Pull complete
2c1ce468d9f3: Pull complete
60311e4cb186: Pull complete
737fbe2f62b3: Pull complete
f8c9b9f6fc37: Pull complete
c5c2025aeb01: Pull complete
cbfea2686041: Pull complete
c5c05e90d285: Pull complete
2f942f92030d: Pull complete
b4b88e6e1442: Pull complete
Digest: sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 24.177 total

ben@tr-ubuntu3 ~ ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558'
Starting dockerd. Data root: '/tmp/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558: Pulling from watonomous/actions-runner-image
c7de327890c7: Pull complete
fd0cc26627dc: Pull complete
fe803e696e73: Pull complete
e034240e93b8: Pull complete
4bbafbe376e8: Pull complete
2c1ce468d9f3: Pull complete
60311e4cb186: Pull complete
737fbe2f62b3: Pull complete
f8c9b9f6fc37: Pull complete
c5c2025aeb01: Pull complete
cbfea2686041: Pull complete
c5c05e90d285: Pull complete
2f942f92030d: Pull complete
b4b88e6e1442: Pull complete
Digest: sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 29.452 total

Pulling the zstd image directly from the internet is the fastest. It appears that the uncompressed image is slower to pull because of the extraction step.

When using the proxy, a lot of the time the docker client is stuck on waiting to download. The wait time is a bit shorter when running the proxy on rootful docker than on rootless docker. The timing above is from rootful docker.

@ben-z
Copy link
Member Author

ben-z commented Aug 12, 2024

Testing using tmpfs (uncompressed from internet, uncompressed from proxy, zstd from internet, zstd from proxy). Note a custom docker daemon.json is required to use with /dev/shm:

{"storage-driver": "fuse-overlayfs"}

docker-tmpfs-storage-driver.pdf

ben@tr-ubuntu3 ~/tmp ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKER_DATA_ROOT=/dev/shm/docker DOCKERD_CONFIG_FILE=/home/ben/tmp/docker-daemon.json; export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7'
Starting dockerd. Data root: '/dev/shm/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7: Pulling from watonomous/actions-runner-image
2a26336a42c7: Pull complete
791992b420bf: Pull complete
1b58bbb87787: Pull complete
982557af76dd: Pull complete
a92b8f6a44d1: Pull complete
5f70bf18a086: Pull complete
dd6a69b8563f: Pull complete
33f6ca0d2683: Pull complete
37584b9a1e75: Pull complete
a9ea8a09f0cd: Pull complete
584ff94048f5: Pull complete
8fbaeb6d06cd: Pull complete
25f0eb003cad: Pull complete
8cdd57217c99: Pull complete
Digest: sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.03s system 0% cpu 29.255 total

ben@tr-ubuntu3 ~/tmp ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKER_DATA_ROOT=/dev/shm/docker DOCKERD_CONFIG_FILE=/home/ben/tmp/docker-daemon.json; export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7'
Starting dockerd. Data root: '/dev/shm/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7: Pulling from watonomous/actions-runner-image
2a26336a42c7: Pull complete
791992b420bf: Pull complete
1b58bbb87787: Pull complete
982557af76dd: Pull complete
a92b8f6a44d1: Pull complete
5f70bf18a086: Pull complete
dd6a69b8563f: Pull complete
33f6ca0d2683: Pull complete
37584b9a1e75: Pull complete
a9ea8a09f0cd: Pull complete
584ff94048f5: Pull complete
8fbaeb6d06cd: Pull complete
25f0eb003cad: Pull complete
8cdd57217c99: Pull complete
Digest: sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
ghcr.io/watonomous/actions-runner-image@sha256:8f3b99ad957270c48022219df78cd1370c2e0a5d8feee9a23d317df7fd6497d7
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.00s user 0.02s system 0% cpu 28.171 total

ben@tr-ubuntu3 ~/tmp ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKER_DATA_ROOT=/dev/shm/docker DOCKERD_CONFIG_FILE=/home/ben/tmp/docker-daemon.json; export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558'
Starting dockerd. Data root: '/dev/shm/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558: Pulling from watonomous/actions-runner-image
c7de327890c7: Pull complete
fd0cc26627dc: Pull complete
fe803e696e73: Pull complete
e034240e93b8: Pull complete
4bbafbe376e8: Pull complete
2c1ce468d9f3: Pull complete
60311e4cb186: Pull complete
737fbe2f62b3: Pull complete
f8c9b9f6fc37: Pull complete
c5c2025aeb01: Pull complete
cbfea2686041: Pull complete
c5c05e90d285: Pull complete
2f942f92030d: Pull complete
b4b88e6e1442: Pull complete
Digest: sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.01s user 0.01s system 0% cpu 18.640 total


ben@tr-ubuntu3 ~/tmp ❯ time srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist thor-slurm1 --pty bash -c 'export DOCKER_DATA_ROOT=/dev/shm/docker DOCKERD_CONFIG_FILE=/home/ben/tmp/docker-daemon.json; export DOCKERD_ROOTLESS_ROOTLESSKIT_DISABLE_HOST_LOOPBACK=false; export DOCKER_HOST=unix:///tmp/run/docker.sock; export HTTP_PROXY=http://10.0.2.2:3128/; export HTTPS_PROXY=$HTTP_PROXY; slurm-start-dockerd.sh && docker pull ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558'
Starting dockerd. Data root: '/dev/shm/docker'. Log file: '/tmp/dockerd.log'
Waiting for dockerd to start...
Dockerd started successfully!

Test it with:
docker run --rm hello-world

ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558: Pulling from watonomous/actions-runner-image
c7de327890c7: Pull complete
fd0cc26627dc: Pull complete
fe803e696e73: Pull complete
e034240e93b8: Pull complete
4bbafbe376e8: Pull complete
2c1ce468d9f3: Pull complete
60311e4cb186: Pull complete
737fbe2f62b3: Pull complete
f8c9b9f6fc37: Pull complete
c5c2025aeb01: Pull complete
cbfea2686041: Pull complete
c5c05e90d285: Pull complete
2f942f92030d: Pull complete
b4b88e6e1442: Pull complete
Digest: sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
Status: Downloaded newer image for ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
ghcr.io/watonomous/actions-runner-image@sha256:cefe2064426f6c7bf8b38b0216e5ef87cca023172be39296ec47394fac083558
srun --cpus-per-task 16 --mem 16G --gres gpu:1,tmpdisk:20480 --nodelist  --pt  0.00s user 0.02s system 0% cpu 24.620 total

The runs with proxy appear to hang for about 5-10 seconds in the beginning and "Waiting" once in a while. Otherwise downloading is very fast.

In this test, zstd from the internet is still the fastest, followed by zstd from proxy. If we can figure out why the proxy is hanging once in a while, then we can probably achieve the same speed as/faster than pulling from the internet at a higher bandwidth (concurrent clients).

@ben-z ben-z changed the title Use zstd compression and add more tags Use estargz compression and add more tags Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant