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

Feature : Support building prepared container on top of non already pulled OCI image #3

Open
telliere opened this issue Mar 22, 2024 · 0 comments

Comments

@telliere
Copy link
Collaborator

Current error :

[LUMI-SD][Container preparation] Entering entrypoint
[LUMI-SD][Container preparation] Encryption mode is on. Registering and running SPIRE Agent
[LUMI-SD][Container preparation] Run container preparation
Checking the access to docker socket at /var/run/docker.sock
Building SD-CONTAINER ready OSI image
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 265, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.44/images/talinx/jp2a/json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/container_preparation/./prepare_container.py", line 28, in <module>
    prepared_image_tag = build_prepared_image(
  File "/container_preparation/lib/image_build.py", line 78, in build_prepared_image
    dockerfile_obj = generate_prepared_dockerfile(
  File "/container_preparation/lib/image_build.py", line 24, in generate_prepared_dockerfile
    base_image = docker_client.images.get(base_image_tag)
  File "/usr/local/lib/python3.9/site-packages/docker/models/images.py", line 333, in get
    return self.prepare_model(self.client.api.inspect_image(name))
  File "/usr/local/lib/python3.9/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/docker/api/image.py", line 251, in inspect_image
    return self._result(
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 271, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python3.9/site-packages/docker/api/client.py", line 267, in _raise_for_status
    raise create_api_error_from_http_exception(e) from e
  File "/usr/local/lib/python3.9/site-packages/docker/errors.py", line 39, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation) from e
docker.errors.ImageNotFound: 404 Client Error for http+docker://localhost/v1.44/images/talinx/jp2a/json: Not Found ("No such image: talinx/jp2a:latest")
Cleaning everything before leaving ...

This error comes from the fact that the user didn't run

docker pull talinx/jp2a

beforehand.

We could modify this code's behaviour to pull image if it doesn't exist

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

No branches or pull requests

1 participant