Spaces:
Sleeping
Sleeping
Commit
·
1312ca7
1
Parent(s):
d22211a
Fix use of ARG in Dockerfile
Browse files- .github/workflows/CI_docker.yml +5 -4
- .github/workflows/CI_docker_large_nightly.yml +3 -3
- Dockerfile +24 -20
.github/workflows/CI_docker.yml
CHANGED
|
@@ -29,12 +29,13 @@ jobs:
|
|
| 29 |
strategy:
|
| 30 |
matrix:
|
| 31 |
julia-version: ['1.7.1']
|
| 32 |
-
python-version: ['3.9']
|
| 33 |
os: [ubuntu-latest]
|
| 34 |
-
|
|
|
|
| 35 |
steps:
|
| 36 |
- uses: actions/[email protected]
|
| 37 |
- name: Build docker
|
| 38 |
-
run: docker build -t pysr .
|
| 39 |
- name: Test docker
|
| 40 |
-
run: docker run --rm pysr /bin/bash -c 'python3 -m unittest test.test'
|
|
|
|
| 29 |
strategy:
|
| 30 |
matrix:
|
| 31 |
julia-version: ['1.7.1']
|
| 32 |
+
python-version: ['3.9.10']
|
| 33 |
os: [ubuntu-latest]
|
| 34 |
+
arch: ['linux/x86_64']
|
| 35 |
+
|
| 36 |
steps:
|
| 37 |
- uses: actions/[email protected]
|
| 38 |
- name: Build docker
|
| 39 |
+
run: docker build -t pysr --build-arg ARCH=${{ matrix.arch }} --build-arg VERSION=${{ matrix.julia-version }} --build-arg PYVERSION=${{ matrix.python-version }} .
|
| 40 |
- name: Test docker
|
| 41 |
+
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m unittest test.test'
|
.github/workflows/CI_docker_large_nightly.yml
CHANGED
|
@@ -18,13 +18,13 @@ jobs:
|
|
| 18 |
fail-fast: false
|
| 19 |
matrix:
|
| 20 |
julia-version: ['1.7.1']
|
| 21 |
-
python-version: ['3.9']
|
| 22 |
os: [ubuntu-latest]
|
| 23 |
-
arch: ['linux/x86_64', 'linux/amd64', 'linux/
|
| 24 |
|
| 25 |
steps:
|
| 26 |
- uses: actions/[email protected]
|
| 27 |
- name: Build docker
|
| 28 |
-
run: docker build --
|
| 29 |
- name: Test docker
|
| 30 |
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m unittest test.test'
|
|
|
|
| 18 |
fail-fast: false
|
| 19 |
matrix:
|
| 20 |
julia-version: ['1.7.1']
|
| 21 |
+
python-version: ['3.9.10']
|
| 22 |
os: [ubuntu-latest]
|
| 23 |
+
arch: ['linux/x86_64', 'linux/amd64', 'linux/aarch64']
|
| 24 |
|
| 25 |
steps:
|
| 26 |
- uses: actions/[email protected]
|
| 27 |
- name: Build docker
|
| 28 |
+
run: docker build -t pysr --build-arg ARCH=${{ matrix.arch }} --build-arg VERSION=${{ matrix.julia-version }} --build-arg PYVERSION=${{ matrix.python-version }} .
|
| 29 |
- name: Test docker
|
| 30 |
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m unittest test.test'
|
Dockerfile
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
# This builds a dockerfile containing a working copy of PySR
|
| 2 |
# with all pre-requisites installed.
|
| 3 |
|
|
|
|
| 4 |
ARG VERSION=latest
|
| 5 |
|
| 6 |
-
FROM julia:$VERSION
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
| 9 |
make build-essential libssl-dev zlib1g-dev \
|
|
@@ -19,28 +23,28 @@ WORKDIR /pysr
|
|
| 19 |
RUN curl https://pyenv.run | bash
|
| 20 |
ENV PATH="/root/.pyenv/bin:$PATH"
|
| 21 |
|
| 22 |
-
ENV
|
| 23 |
-
RUN PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${
|
| 24 |
-
ENV PATH="/root/.pyenv/versions/$
|
| 25 |
|
| 26 |
-
# Install IPython and other useful libraries:
|
| 27 |
-
RUN pip install ipython jupyter matplotlib
|
| 28 |
|
| 29 |
-
# Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
|
| 30 |
-
ADD ./requirements.txt /pysr/requirements.txt
|
| 31 |
-
RUN pip3 install -r /pysr/requirements.txt
|
| 32 |
|
| 33 |
-
# Install PySR:
|
| 34 |
-
# We do a minimal copy so it doesn't need to rerun at every file change:
|
| 35 |
-
ADD ./setup.py /pysr/setup.py
|
| 36 |
-
ADD ./README.md /pysr/README.md
|
| 37 |
-
ADD ./pysr/ /pysr/pysr/
|
| 38 |
-
RUN pip3 install .
|
| 39 |
|
| 40 |
-
# Install Julia pre-requisites:
|
| 41 |
-
RUN python3 -c 'import pysr; pysr.install()'
|
| 42 |
|
| 43 |
-
# Add tests
|
| 44 |
-
ADD ./test/ /pysr/test/
|
| 45 |
|
| 46 |
-
CMD ["bash"]
|
|
|
|
| 1 |
# This builds a dockerfile containing a working copy of PySR
|
| 2 |
# with all pre-requisites installed.
|
| 3 |
|
| 4 |
+
ARG ARCH=linux/amd64
|
| 5 |
ARG VERSION=latest
|
| 6 |
|
| 7 |
+
FROM --platform=$ARCH julia:$VERSION
|
| 8 |
+
|
| 9 |
+
# Need to use ARG after FROM, otherwise it won't get passed through.
|
| 10 |
+
ARG PYVERSION=3.9.10
|
| 11 |
|
| 12 |
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
|
| 13 |
make build-essential libssl-dev zlib1g-dev \
|
|
|
|
| 23 |
RUN curl https://pyenv.run | bash
|
| 24 |
ENV PATH="/root/.pyenv/bin:$PATH"
|
| 25 |
|
| 26 |
+
# ENV PYVERSION=${PYVERSION}
|
| 27 |
+
RUN PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${PYVERSION}
|
| 28 |
+
# ENV PATH="/root/.pyenv/versions/$PYVERSION/bin:$PATH"
|
| 29 |
|
| 30 |
+
# # Install IPython and other useful libraries:
|
| 31 |
+
# RUN pip install ipython jupyter matplotlib
|
| 32 |
|
| 33 |
+
# # Caches install (https://stackoverflow.com/questions/25305788/how-to-avoid-reinstalling-packages-when-building-docker-image-for-python-project)
|
| 34 |
+
# ADD ./requirements.txt /pysr/requirements.txt
|
| 35 |
+
# RUN pip3 install -r /pysr/requirements.txt
|
| 36 |
|
| 37 |
+
# # Install PySR:
|
| 38 |
+
# # We do a minimal copy so it doesn't need to rerun at every file change:
|
| 39 |
+
# ADD ./setup.py /pysr/setup.py
|
| 40 |
+
# ADD ./README.md /pysr/README.md
|
| 41 |
+
# ADD ./pysr/ /pysr/pysr/
|
| 42 |
+
# RUN pip3 install .
|
| 43 |
|
| 44 |
+
# # Install Julia pre-requisites:
|
| 45 |
+
# RUN python3 -c 'import pysr; pysr.install()'
|
| 46 |
|
| 47 |
+
# # Add tests
|
| 48 |
+
# ADD ./test/ /pysr/test/
|
| 49 |
|
| 50 |
+
# CMD ["bash"]
|