-
Notifications
You must be signed in to change notification settings - Fork 65
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
Make libnuma into a soft dependency #196
Merged
arthurp
merged 4 commits into
KatanaGraph:master
from
arthurp:feature/soft-dep-on-libnuma
Apr 30, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
99ca085
Fix`scripts/version` which failed during python build.
arthurp 72670c4
Add script to test conda packages in arbitrary docker base images.
arthurp 5e961c2
[ENG-324] Make libnuma a soft dependency using dlopen.
arthurp 3cb2d0c
Clean up HWTopoLinux code for style.
arthurp 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 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 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 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 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 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 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 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,59 @@ | ||
ARG BASE_IMAGE | ||
FROM ${BASE_IMAGE} AS base_with_conda | ||
|
||
COPY download_miniconda.sh / | ||
COPY activate_miniconda.sh / | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=America/Chicago | ||
ENV APT_GET="apt-get --yes --quiet" | ||
ENV YUM="yum -y" | ||
|
||
RUN set -eux; \ | ||
if command -v yum > /dev/null; then \ | ||
${YUM} update; \ | ||
${YUM} install curl; \ | ||
${YUM} clean all; \ | ||
else \ | ||
${APT_GET} update; \ | ||
${APT_GET} dist-upgrade; \ | ||
${APT_GET} install curl; \ | ||
${APT_GET} clean; \ | ||
fi | ||
|
||
RUN set -eu; \ | ||
bash /download_miniconda.sh ubuntu-xxx; \ | ||
. /activate_miniconda.sh; | ||
|
||
ARG CONDA_CLEAN="conda clean --quiet --yes --all" | ||
|
||
RUN set -eu; \ | ||
. /activate_miniconda.sh; \ | ||
mamba update --quiet --yes --all; \ | ||
${CONDA_CLEAN} | ||
|
||
FROM base_with_conda AS pre_install | ||
|
||
COPY packages /packages | ||
|
||
FROM pre_install AS test_python | ||
ARG CONDA_CLEAN="conda clean --quiet --yes --all" | ||
ARG MAMBA_INSTALL="mamba install --quiet --yes --channel /packages" | ||
|
||
RUN set -eu ; . /activate_miniconda.sh; set -x ; \ | ||
${MAMBA_INSTALL} katana-python; \ | ||
${CONDA_CLEAN} | ||
|
||
RUN set -eu ; . /activate_miniconda.sh; set -x ; \ | ||
python -c "import katana.analytics; katana.analytics.bfs; print(katana.__version__)" | ||
|
||
FROM pre_install AS test_tools | ||
ARG CONDA_CLEAN="conda clean --quiet --yes --all" | ||
ARG MAMBA_INSTALL="mamba install --quiet --yes --channel /packages" | ||
|
||
RUN set -eu ; . /activate_miniconda.sh; set -x ; \ | ||
${MAMBA_INSTALL} katana-tools; \ | ||
${CONDA_CLEAN} | ||
|
||
RUN set -eu ; . /activate_miniconda.sh; set -x ; \ | ||
graph-convert --version |
This file contains 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,37 @@ | ||
#! /bin/python | ||
|
||
import argparse | ||
from pathlib import Path | ||
from subprocess import Popen, PIPE | ||
from sys import stderr | ||
import tarfile | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description="Install katana packages in a docker image and test them. " "Only runs a trivial test." | ||
) | ||
parser.add_argument("package_dir", type=Path, help="The directory containing the conda packages to install.") | ||
parser.add_argument("docker_image", type=str, help="The docker image to use.") | ||
|
||
args = parser.parse_args() | ||
|
||
docker_proc = Popen(["docker", "build", "-", "--build-arg", f"BASE_IMAGE={args.docker_image}",], stdin=PIPE) | ||
with docker_proc.stdin, tarfile.open(fileobj=docker_proc.stdin, mode="w:gz") as context_tar: | ||
context_tar.add(Path(args.package_dir).absolute(), arcname="packages") | ||
context_tar.add(Path(__file__).parent / "install_conda_packages_test.Dockerfile", arcname="Dockerfile") | ||
context_tar.add( | ||
Path(__file__).parent.parent / ".github" / "workflows" / "download_miniconda.sh", | ||
arcname="download_miniconda.sh", | ||
) | ||
context_tar.add( | ||
Path(__file__).parent.parent / ".github" / "workflows" / "activate_miniconda.sh", | ||
arcname="activate_miniconda.sh", | ||
) | ||
err_code = docker_proc.wait() | ||
if err_code != 0: | ||
print(f"Failed to install and test Conda packages from {args.package_dir} in {args.docker_image}", file=stderr) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddn0 Did I over do the docker image matrix? Should I include anything else? They take about 5min each and all run in parallel after
build_and_test_conda_package
finishes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might add ubuntu:18.04 and ubuntu:20.04 explicitly (in addition to
ubuntu:latest
). But I don't have a strong preference.