Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
FROM python:3.12-slim-trixie
FROM python:3.9-slim-trixie

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version of the image self was chosen based on the uv documentation (see #92 (comment)). Maybe now the image from the micromamba documentation is suitable for this Dockerfile? If not, a Debian slim image (without a python) would be enough, if micromamba does not need a Python version itself.


# The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git dos2unix vim
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git nano dos2unix bzip2 build-essential

# Download the latest installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If uv is not used for installing the different python versions, as it does not support version 3.6, I would suggest removing it from the image (Line 7 to 13 including). Or does micromamba needs it?


# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the `PATH`
# Ensure uv installer is linked
ENV PATH="/root/.local/bin/:$PATH"

# micromamba for Legacy compilers --------------

ADD https://micro.mamba.pm/api/micromamba/linux-64/latest /micromamba.tar.bz2
RUN mkdir -p /opt/micromamba \
&& tar -xjf /micromamba.tar.bz2 -C /opt/micromamba bin/micromamba \
&& rm /micromamba.tar.bz2
ENV MAMBA_ROOT_PREFIX=/opt/micromamba
ENV PATH="/opt/micromamba/bin:${PATH}"

# Create separate envs with pinned Python + pip
RUN /opt/micromamba/bin/micromamba create -y -n py36 -c conda-forge python=3.6 pip && \
/opt/micromamba/bin/micromamba create -y -n py37 -c conda-forge python=3.7 pip && \
/opt/micromamba/bin/micromamba create -y -n py38 -c conda-forge python=3.8 pip && \
/opt/micromamba/bin/micromamba clean -a -y

# Expose python3.X and pip3.X shims
RUN ln -sf /opt/micromamba/envs/py36/bin/python /usr/local/bin/python3.6 && \
ln -sf /opt/micromamba/envs/py37/bin/python /usr/local/bin/python3.7 && \
ln -sf /opt/micromamba/envs/py38/bin/python /usr/local/bin/python3.8 && \
ln -sf /opt/micromamba/envs/py36/bin/pip /usr/local/bin/pip3.6 && \
ln -sf /opt/micromamba/envs/py37/bin/pip /usr/local/bin/pip3.7 && \
ln -sf /opt/micromamba/envs/py38/bin/pip /usr/local/bin/pip3.8
# ---

# Ensure the installed binary is on the `PATH`
ENV BUGSINPY_HOME="/home/bugsinpy/"
ENV PATH="$BUGSINPY_HOME/framework/bin:$PATH"

# Set working directory
WORKDIR /home

# Default command
CMD ["bash"]
CMD ["/bin/bash"]
14 changes: 13 additions & 1 deletion framework/bin/bugsinpy-compile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ elif [[ ! -e "$work_dir/bugsinpy_run_test.sh" ]]; then
exit
fi

# Read python version -------
DONE=false
until $DONE ;do
read || DONE=true
if [[ "$REPLY" == "python_version"* ]]; then
PYVER="$(cut -d'"' -f 2 <<< $REPLY)"
fi
done < "$work_dir/bugsinpy_bug.info"
PYVER=${PYVER%.*}


###Check dos2unix
#check_dos2unix=$(dos2unix --version 2>&1)
#if [ "$check_dos2unix" == *"not found"* ]; then
Expand All @@ -54,7 +65,8 @@ fi
rm -r -f env/

###Add environment
python3 -m venv env
echo "python${PYVER} -m venv env"
python${PYVER} -m venv env

###Activate environment
if [ -d "env/Scripts" ]; then
Expand Down
3 changes: 2 additions & 1 deletion projects/PySnooper/bugs/1/setup.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python setup.py install
python setup.py install
pip install python_toolbox
2 changes: 1 addition & 1 deletion projects/ansible/bugs/1/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/10/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/11/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/12/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/13/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/14/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/15/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
4 changes: 2 additions & 2 deletions projects/ansible/bugs/16/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python setup.py install
pip3 install pytest==3.10.1
pip3 install pytest-mock==1.2
pip install pytest==3.10.1 mock
pip install pytest-mock==1.2
2 changes: 1 addition & 1 deletion projects/ansible/bugs/17/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/18/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/2/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
4 changes: 2 additions & 2 deletions projects/ansible/bugs/3/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python setup.py install
pip3 install pytest==3.10.1
pip3 install pytest-mock==1.2
pip install pytest==3.10.1 mock
pip install pytest-mock==1.2
2 changes: 1 addition & 1 deletion projects/ansible/bugs/4/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/5/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/6/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/7/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
2 changes: 1 addition & 1 deletion projects/ansible/bugs/8/setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
python setup.py install
pip3 install pytest==3.10.1
pip install pytest==3.10.1 mock
4 changes: 2 additions & 2 deletions projects/ansible/bugs/9/setup.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python setup.py install
pip3 install pytest==3.10.1
pip3 install pytest-mock==1.2
pip install pytest==3.10.1 mock
pip install pytest-mock==1.2