forked from meta-toolkit/metapy
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Docker support #8
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
abaf87e
Add Dockerfile based on MeTA
josecols 224af87
Update Readme
josecols 42fa9f8
Add GH Workflow for Docker image generation
josecols cc2dd01
Change MeTA submodule reference
josecols f2c938b
Avoid initializing MeTA submodule on Docker
josecols b425ebd
Test development arch
josecols 9e93536
Limit LD_PRELOAD reference to metapy build
josecols 22252cb
Fix LD_PRELOAD for amd64
josecols 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Docker Image CI | ||
|
||
concurrency: | ||
group: docker-image-ci | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
# branches: | ||
# - master | ||
workflow_run: | ||
workflows: [ "Docker Base Image CI" ] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64,amd64 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64 | ||
push: true | ||
tags: josecols/metapy:0.2.13 |
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ doc/ | |
*.o | ||
*.class | ||
.* | ||
!.github/ | ||
data/ceeaus | ||
data/breast-cancer | ||
data/housing | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "deps/meta"] | ||
path = deps/meta | ||
url = https://github.com/meta-toolkit/meta.git | ||
url = https://github.com/dmcguire81/meta | ||
[submodule "deps/pybind11"] | ||
path = deps/pybind11 | ||
url = https://github.com/pybind/pybind11 |
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,25 @@ | ||
FROM josecols/meta:3.0.2 as base | ||
|
||
ARG TARGETARCH | ||
COPY . /metapy | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
python-is-python3 \ | ||
python3-dev \ | ||
python3-pip | ||
|
||
WORKDIR /metapy | ||
RUN git submodule update --init --recursive -- deps/pybind11 | ||
RUN mkdir build | ||
RUN sed -i 's:add_subdirectory(deps/meta EXCLUDE_FROM_ALL):find_package(MeTA 3.0.2 REQUIRED):g' CMakeLists.txt | ||
RUN pip install . | ||
|
||
FROM base AS branch-arm64 | ||
ENV LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so.2 | ||
|
||
FROM base AS branch-amd64 | ||
ENV LD_PRELOAD=/lib/x86_64-linux-gnu/libjemalloc.so.2 | ||
|
||
FROM branch-${TARGETARCH} AS final | ||
|
||
WORKDIR /app |
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
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.
So this just builds the
pybind11
code and not the dependencies?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.
Yes, MeTA and its dependencies are already built as libraries.