Skip to content

Commit 3ff743a

Browse files
Merge pull request #2765 from opentensor/feat/roman/add-pull-docker-image
Add logic for keep docker image up to date
2 parents 14c2f47 + 0f186c4 commit 3ff743a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/e2e-subtensor-tests.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ jobs:
4949
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
5050

5151
- name: Pull Docker Image
52-
run: docker pull ghcr.io/opentensor/subtensor-localnet:latest
52+
run: docker pull ghcr.io/opentensor/subtensor-localnet:devnet-ready
5353

5454
- name: Save Docker Image to Cache
55-
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:latest
55+
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:devnet-ready
5656

5757
- name: Upload Docker Image as Artifact
5858
uses: actions/upload-artifact@v4

tests/e2e_tests/conftest.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
setup_wallet,
2020
)
2121

22+
LOCALNET_IMAGE_NAME = "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
23+
2224

2325
def wait_for_node_start(process, timestamp=None):
2426
"""Waits for node to start in the docker."""
@@ -132,6 +134,7 @@ def is_docker_running():
132134
stderr=subprocess.DEVNULL,
133135
check=True,
134136
)
137+
subprocess.run(["docker", "pull", LOCALNET_IMAGE_NAME], check=True)
135138
return True
136139
except subprocess.CalledProcessError:
137140
return False
@@ -162,7 +165,6 @@ def try_start_docker():
162165
return False
163166

164167
container_name = f"test_local_chain_{str(time.time()).replace(".", "_")}"
165-
image_name = "ghcr.io/opentensor/subtensor-localnet:devnet-ready"
166168

167169
# Command to start container
168170
cmds = [
@@ -175,7 +177,7 @@ def try_start_docker():
175177
"9944:9944",
176178
"-p",
177179
"9945:9945",
178-
image_name,
180+
LOCALNET_IMAGE_NAME,
179181
params,
180182
]
181183

0 commit comments

Comments
 (0)