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

feat: infer package manager from container exec and set package as an interface #237

Merged
merged 25 commits into from
Dec 4, 2023

Conversation

musdotdigital
Copy link
Contributor

@musdotdigital musdotdigital commented Nov 29, 2023

We strip reliance on parsing dockerfile to determine the package manager, we now execute the container in order to determine the package manager to use. This mean that we can support a wider range of dockerfiles without needing custom logic added.

A quick change to use package as an interface as opposed to a class is cleaner in implementation and provided a nice downstream feature to the updater. We can now parse multiple keys from the dependency, while continuing to only be concerned with name and version. As dependency manifests containing extra keys are not overwritten by the updater, we can now support declarations such as this:

[
  {
    "name": "git",
    "version": "2.34.1-r0",
    "extraKey": "field"
  }
]

In this PR we also provide support for ubuntu flavoured images such as the nvidia/cuda.

How to test

npm run build && npm run test

You can test this with different images by providing a new dockerfile and dependency to main.test.ts, for example I tested this for the an nvidia image with

FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04

and updating dependencies.json to:

[
   {
        "name": "nvidia-docker2",
        "version": "2.13.0-1",
        "reason": "docker"
    }
]

@musdotdigital musdotdigital changed the title feat/upgrade with docker dep feat: handle ubuntu images and multiple argument pkgs Nov 29, 2023
@musdotdigital musdotdigital changed the title feat: handle ubuntu images and multiple argument pkgs feat: handle ubuntu images and package as an interface Nov 30, 2023
@musdotdigital musdotdigital marked this pull request as ready for review November 30, 2023 13:47
@musdotdigital musdotdigital changed the title feat: handle ubuntu images and package as an interface feat: infer package manager from container exec and set package as an interface Nov 30, 2023
src/image.ts Outdated Show resolved Hide resolved
src/main.ts Outdated Show resolved Hide resolved
@musdotdigital musdotdigital merged commit a9335dd into main Dec 4, 2023
3 checks passed
@musdotdigital musdotdigital deleted the feat/upgrade-with-docker-dep branch December 4, 2023 14:38
@mblottiere
Copy link
Collaborator

mblottiere commented Dec 4, 2023

This probably deserves a v1.1.0

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.

None yet

3 participants