diff --git a/cli/jobs/single-step/r/accidents/docker-context/Dockerfile b/cli/jobs/single-step/r/accidents/docker-context/Dockerfile index bbac6319ec4..d59a9b59404 100644 --- a/cli/jobs/single-step/r/accidents/docker-context/Dockerfile +++ b/cli/jobs/single-step/r/accidents/docker-context/Dockerfile @@ -2,18 +2,18 @@ FROM rocker/tidyverse:latest # Install python RUN apt-get update -qq && \ - apt-get install -y python3-pip tcl tk libz-dev libpng-dev + apt-get install -y python3-pip tcl tk libz-dev libpng-dev && \ + apt-get install -y python3-venv + +RUN /usr/bin/python3 -m venv /usr/venv/ +RUN bash /usr/venv/bin/activate RUN ln -f /usr/bin/python3 /usr/bin/python RUN ln -f /usr/bin/pip3 /usr/bin/pip -RUN pip install -U pip # Install azureml-mlflow -RUN pip install azureml-mlflow -RUN pip install mlflow - -# Create link for python -RUN ln -f /usr/bin/python3 /usr/bin/python +RUN /usr/venv/bin/pip install azureml-mlflow +RUN /usr/venv/bin/pip install mlflow # Install additional R packages RUN R -e "install.packages(c('mlflow'), repos = 'https://cloud.r-project.org/')" diff --git a/cli/jobs/single-step/r/accidents/job.yml b/cli/jobs/single-step/r/accidents/job.yml index 4457fcf3f25..1c1a3228130 100644 --- a/cli/jobs/single-step/r/accidents/job.yml +++ b/cli/jobs/single-step/r/accidents/job.yml @@ -1,6 +1,7 @@ $schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json code: src command: >- + source /usr/venv/bin/activate Rscript accidents.R --data ${{inputs.training_data}} inputs: diff --git a/cli/jobs/single-step/r/iris/docker-context/Dockerfile b/cli/jobs/single-step/r/iris/docker-context/Dockerfile index bbac6319ec4..d59a9b59404 100644 --- a/cli/jobs/single-step/r/iris/docker-context/Dockerfile +++ b/cli/jobs/single-step/r/iris/docker-context/Dockerfile @@ -2,18 +2,18 @@ FROM rocker/tidyverse:latest # Install python RUN apt-get update -qq && \ - apt-get install -y python3-pip tcl tk libz-dev libpng-dev + apt-get install -y python3-pip tcl tk libz-dev libpng-dev && \ + apt-get install -y python3-venv + +RUN /usr/bin/python3 -m venv /usr/venv/ +RUN bash /usr/venv/bin/activate RUN ln -f /usr/bin/python3 /usr/bin/python RUN ln -f /usr/bin/pip3 /usr/bin/pip -RUN pip install -U pip # Install azureml-mlflow -RUN pip install azureml-mlflow -RUN pip install mlflow - -# Create link for python -RUN ln -f /usr/bin/python3 /usr/bin/python +RUN /usr/venv/bin/pip install azureml-mlflow +RUN /usr/venv/bin/pip install mlflow # Install additional R packages RUN R -e "install.packages(c('mlflow'), repos = 'https://cloud.r-project.org/')" diff --git a/cli/jobs/single-step/r/iris/job.yml b/cli/jobs/single-step/r/iris/job.yml index 8997c01e235..1d2533a6a48 100644 --- a/cli/jobs/single-step/r/iris/job.yml +++ b/cli/jobs/single-step/r/iris/job.yml @@ -1,5 +1,6 @@ $schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json command: > + source /usr/venv/bin/activate Rscript train.R --data_folder ${{inputs.iris}} code: src