Skip to content

Commit

Permalink
Remove references to databuilder
Browse files Browse the repository at this point in the history
There is no `databuilder:v1` image so we need to get rid of this.
  • Loading branch information
evansd committed Dec 12, 2023
1 parent fb75bdd commit 46defb4
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
6 changes: 4 additions & 2 deletions opensafely/pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"Command for updating the docker images used to run OpenSAFELY studies locally"
)
REGISTRY = config.DOCKER_REGISTRY
IMAGES = list(config.ALLOWED_IMAGES)
# The deprecated `databuilder` name is still supported by job-runner, but we don't want
# it showing up here
IMAGES = list(config.ALLOWED_IMAGES - {"databuilder"})
FULL_IMAGES = {f"{REGISTRY}/{image}" for image in IMAGES}
DEPRECATED_REGISTRIES = ["docker.opensafely.org", "ghcr.io/opensafely"]
IMAGES.sort() # this is just for consistency for testing
Expand Down Expand Up @@ -129,7 +131,7 @@ def remove_deprecated_images(local_images):


def get_default_version_for_image(name):
if name in ["databuilder", "ehrql"]:
if name in ["ehrql"]:
return "v1"
else:
return "latest"
Expand Down
24 changes: 12 additions & 12 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def test_execute_main_args(run, no_user):
"HOME=/tmp",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
"foo",
"bar",
"baz",
],
)
assert run_main(execute, "databuilder:v1 foo bar baz") == 0
assert run_main(execute, "ehrql:v1 foo bar baz") == 0


def test_execute_main_entrypoint(run, no_user):
Expand All @@ -50,10 +50,10 @@ def test_execute_main_entrypoint(run, no_user):
"--entrypoint=/entrypoint",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
run_main(execute, "--entrypoint /entrypoint databuilder:v1")
run_main(execute, "--entrypoint /entrypoint ehrql:v1")


def test_execute_main_env(run, no_user):
Expand All @@ -79,10 +79,10 @@ def test_execute_main_env(run, no_user):
"BAZ=1",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
run_main(execute, "-e=FOO -e BAR --env BAZ=1 databuilder:v1")
run_main(execute, "-e=FOO -e BAR --env BAZ=1 ehrql:v1")


def test_execute_main_env_in_env(run, no_user):
Expand All @@ -102,10 +102,10 @@ def test_execute_main_env_in_env(run, no_user):
"HOME=/foo",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
run_main(execute, "-e OPENSAFELY_BACKEND=tpp -e HOME=/foo databuilder:v1")
run_main(execute, "-e OPENSAFELY_BACKEND=tpp -e HOME=/foo ehrql:v1")


@pytest.mark.parametrize("default", [None, "uid:gid"])
Expand All @@ -129,10 +129,10 @@ def test_execute_main_user_cli_arg_overrides(default, run, monkeypatch):
"HOME=/tmp",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
run_main(execute, "-u 1234:5678 databuilder:v1")
run_main(execute, "-u 1234:5678 ehrql:v1")


def test_execute_main_user_linux_disble(run, monkeypatch):
Expand All @@ -154,10 +154,10 @@ def test_execute_main_user_linux_disble(run, monkeypatch):
"HOME=/tmp",
"--cpus=2.0",
"--memory=4G",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
run_main(execute, "-u None databuilder:v1")
run_main(execute, "-u None ehrql:v1")


def test_execute_main_stata_license(run, monkeypatch, no_user):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def test_default_no_local_images_force(run, capsys):
stdout="",
)
run.expect(["docker", "pull", tag("cohortextractor")])
run.expect(["docker", "pull", tag("databuilder", version="v1")])
run.expect(["docker", "pull", tag("ehrql", version="v1")])
run.expect(["docker", "pull", tag("jupyter")])
run.expect(["docker", "pull", tag("python")])
Expand All @@ -68,7 +67,6 @@ def test_default_no_local_images_force(run, capsys):
assert err == ""
assert out.splitlines() == [
"Updating OpenSAFELY cohortextractor image",
"Updating OpenSAFELY databuilder image",
"Updating OpenSAFELY ehrql image",
"Updating OpenSAFELY jupyter image",
"Updating OpenSAFELY python image",
Expand Down
16 changes: 8 additions & 8 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ def test_run_docker_user_default(run, monkeypatch):
"--init",
"--label=opensafely",
f"--volume={pathlib.Path.cwd()}://workspace",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
utils.run_docker([], "databuilder:v1", [])
utils.run_docker([], "ehrql:v1", [])


def test_run_docker_user_linux(run, monkeypatch):
Expand All @@ -82,10 +82,10 @@ def test_run_docker_user_linux(run, monkeypatch):
"--label=opensafely",
"--user=uid:gid",
f"--volume={pathlib.Path.cwd()}://workspace",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
utils.run_docker([], "databuilder:v1", [])
utils.run_docker([], "ehrql:v1", [])


def test_run_docker_interactive(run, no_user):
Expand All @@ -98,10 +98,10 @@ def test_run_docker_interactive(run, no_user):
"--label=opensafely",
"--interactive",
f"--volume={pathlib.Path.cwd()}://workspace",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
utils.run_docker([], "databuilder:v1", [], interactive=True)
utils.run_docker([], "ehrql:v1", [], interactive=True)


def test_run_docker_interactive_tty(run, no_user, monkeypatch):
Expand All @@ -117,7 +117,7 @@ def test_run_docker_interactive_tty(run, no_user, monkeypatch):
"--interactive",
"--tty",
f"--volume={pathlib.Path.cwd()}://workspace",
"ghcr.io/opensafely-core/databuilder:v1",
"ghcr.io/opensafely-core/ehrql:v1",
],
)
utils.run_docker([], "databuilder:v1", [], interactive=True)
utils.run_docker([], "ehrql:v1", [], interactive=True)

0 comments on commit 46defb4

Please sign in to comment.