Repository navigation
Fix/rebase image and add scan gate #372
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9f3084b
changes to the container for harbor
8721656
changelog
b372597
fix pytest
f177d2b
address copilot
b43d5ca
revert wrongly apllied changes
97c63de
address PR review
l-mansouri 21bfb0b
address comments
l-mansouri 02cee5f
fix issues after trivy rescan
l-mansouri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .git | ||
| .github | ||
| .pytest_cache | ||
| dist | ||
| tests | ||
| docs | ||
| utils | ||
| *.egg-info | ||
| .venv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,78 @@ | ||
| FROM continuumio/miniconda3:26.3.2 | ||
| # Base: condaforge/miniforge3:26.7.2-0 — the official conda-forge image | ||
| # (Ubuntu 24.04 LTS, versioned tags). Replaces continuumio/miniconda3, which is | ||
| # Debian: perl-base is an essential package there, cannot be removed, and has | ||
| # no fix for CVE-2026-13221 / CVE-2026-42496 / CVE-2026-8376 — a floor of 3 | ||
| # unfixable CRITICALs at every miniconda tag. miniforge3 also keeps the | ||
| # environment at /opt/conda, so nothing that hardcodes a conda path changes. | ||
| FROM condaforge/miniforge3:26.7.2-0 | ||
|
dapineyro marked this conversation as resolved.
|
||
|
|
||
| LABEL name="quay.io/lifebitaiorg/cloudos-cli" \ | ||
| description="The cloudos-cli docker container" \ | ||
| maintainer="David Pineyro <davidp@lifebit.ai>" | ||
|
|
||
| # Use the base conda env to not be reliant on conda activate when using pip | ||
| # `apt-get upgrade` matters: the base image lags the security archive, so | ||
| # without it you inherit whatever was current when the base was cut. | ||
| # procps is required by Nextflow for `ps` task tracing. | ||
| RUN apt-get update -y \ | ||
| && apt-get upgrade -y \ | ||
| && apt-get install -y --no-install-recommends procps \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # mamba ships in this base, so the old `conda install mamba` step is gone. | ||
| ARG ENV_NAME="base" | ||
| COPY environment.yml / | ||
| RUN conda env update --quiet --name ${ENV_NAME} --file /environment.yml \ | ||
| && conda clean -a -y | ||
|
|
||
| # Install mamba for faster installation in the subsequent step | ||
| RUN conda install -c conda-forge mamba -y | ||
| ENV PATH=/opt/conda/envs/${ENV_NAME}/bin:$PATH | ||
|
|
||
| # Install the conda environment | ||
| COPY environment.yml / | ||
| RUN mamba env update -y --name ${ENV_NAME} --file /environment.yml -vv && \ | ||
| mamba clean -afy | ||
| COPY . / | ||
|
dapineyro marked this conversation as resolved.
|
||
| ENV PATH=/cloudos_cli:$PATH | ||
| RUN pip install --no-cache-dir -e / \ | ||
| && chmod ugo+x /cloudos_cli/*py /cloudos_cli/jobs/*py /cloudos_cli/utils/*py \ | ||
| && cloudos --help >/dev/null \ | ||
| && python -c "import cloudos_cli" | ||
|
|
||
| # Add conda installation dir to PATH (instead of doing 'conda activate') | ||
| ENV PATH /opt/conda/envs/${ENV_NAME}/bin:$PATH | ||
| # Two cleanups are what take a miniforge3 image to zero. | ||
| # | ||
| # 1. pip vendors its own dependency manifests (pip/_vendor/vendor.txt and | ||
| # bom.cdx.json). Trivy reads them as installed inventory and reports the | ||
| # versions listed there. Metadata only; pip does not read them at runtime. | ||
| # | ||
| # 2. py-rattler is conda's Rust-based resolver. It ships a CycloneDX SBOM | ||
| # declaring the Rust crates linked into its binary, two of which carry HIGH | ||
| # advisories (pyo3, quinn-proto). These are NOT false positives — the code | ||
| # really is in the .so. The environment is fully built by this point and | ||
| # nothing solves dependencies at runtime, so removing the resolver removes | ||
| # real attack surface rather than silencing the scanner. | ||
| # | ||
| # The resolver is four things, not one: the py_rattler/rattler modules, the | ||
| # conda_rattler_solver plugin that dispatches to them, and the conda-meta | ||
| # entries for both. Removing only the modules leaves Trivy's conda-meta | ||
| # analyzer still reporting py-rattler as installed (so a future advisory | ||
| # would fail the gate on code that is no longer here) and leaves the plugin | ||
| # registered against a module that is gone, which turns | ||
| # `conda --solver rattler` into an ImportError. The default solver is | ||
| # libmamba, so nothing routine depends on it. | ||
| # | ||
| # && rather than ;: with ; the layer's exit status is rm's, which is always 0, | ||
| # so a find that errored (a missing /opt/conda, an unreadable tree) was | ||
| # discarded and the build carried on with an image that was never cleaned. | ||
| # Note find still exits 0 when a pattern simply matches nothing, so this | ||
| # guards against a broken tree, not against a base that renames these paths. | ||
| RUN find /opt/conda \( -path "*/pip/_vendor/vendor.txt" \ | ||
| -o -path "*/pip/_vendor/bom.cdx.json" \) -delete \ | ||
| && rm -rf /opt/conda/lib/python*/site-packages/py_rattler* \ | ||
| /opt/conda/lib/python*/site-packages/rattler* \ | ||
| /opt/conda/lib/python*/site-packages/conda_rattler_solver* \ | ||
| /opt/conda/conda-meta/py-rattler-*.json \ | ||
| /opt/conda/conda-meta/conda-rattler-solver-*.json | ||
|
|
||
| # Dump the details of the installed packages to a file for posterity | ||
| RUN mamba env export --name ${ENV_NAME} > ${ENV_NAME}_exported.yml | ||
| # Keep the security update last and in its own layer: earlier layers get cached | ||
| # across rebuilds and a cached update silently stops picking up new patches. | ||
| # The release workflow forces it with --build-arg SECURITY_REFRESH=$(date +%s). | ||
| ARG SECURITY_REFRESH=1 | ||
| RUN apt-get update -y && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Copy local package files to be able to install | ||
| COPY . / | ||
| # Add the created folder to PATH so that tools are accessible | ||
| ENV PATH /cloudos:$PATH | ||
| # Install from local files, -e / points to where the setup.py file is located | ||
| RUN pip install -e / | ||
| # Make the python files executable from anyone (user, group, owner) | ||
| RUN chmod ugo+x /cloudos_cli/*py | ||
| RUN chmod ugo+x /cloudos_cli/jobs/*py | ||
| RUN chmod ugo+x /cloudos_cli/utils/*py | ||
| CMD ["/bin/bash"] | ||
| ENTRYPOINT [] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.