FastAI in docker installation is not successful

Hi,

I am trying to pul fastai/fastai docker image for docker installation. I don’t know if this docker image is official. There are images from paperspace and others. What shall we use? Anyone best practice of using fastai in docker? I am getting the error E: The repository 'https://cli.github.com/packages jammy Release' does not have a Release file. with fastai/fastai image.

Can someone guide how to fix this error and use fastai in docker?

Best Regards,
Bilal

I’ve just tested pulling the fastai image from this Docker Hub and everything is fine. I gues the Docker Image is built from this repo: GitHub - fastai/docker-containers: Docker images for fastai

Thanks dhoa for the response. I am running it from the Dockerfile. Don’t know if that is causing this error:

FROM fastai/fastai

RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm

RUN mkdir -p /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models \
    && chown algorithm:algorithm /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models

RUN apt-get update

RUN apt-get install -y ffmpeg libsm6 libxext6

USER algorithm

WORKDIR /opt/algorithm

ENV PATH="/home/algorithm/.local/bin:${PATH}"

RUN python -m pip install --user -U pip

COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/

RUN python -m pip install --user -rrequirements.txt

COPY --chown=algorithm:algorithm process.py /opt/algorithm/

COPY --chown=algorithm:algorithm ml_utils.py /opt/algorithm/

COPY --chown=algorithm:algorithm test/ /opt/algorithm/input/

COPY --chown=algorithm:algorithm output/ /output/

COPY --chown=algorithm:algorithm models/ /opt/algorithm/models

RUN chmod -R 777 /input /output /images /opt/algorithm

ENTRYPOINT python -m process $0 $@

The output log is below:

(base) bilal@my-PC:~/mlworks/surgtoolloc2022-category-1$ sudo bash test.sh
[sudo] password for bilal: 
Sending build context to Docker daemon  7.426GB
Step 1/17 : FROM fastai/fastai
 ---> f8a8d673e1de
Step 2/17 : RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm
 ---> Using cache
 ---> e2c7654e3622
Step 3/17 : RUN mkdir -p /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models     && chown algorithm:algorithm /opt/algorithm /input /output /images /opt/algorithm/models /opt/algorithm/models
 ---> Running in 26c7a84cab37
Removing intermediate container 26c7a84cab37
 ---> 5bc3775eb7be
Step 4/17 : RUN apt-get update
 ---> Running in 870e6ee6f82d
Ign:1 https://cli.github.com/packages jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Err:4 https://cli.github.com/packages jammy Release
  404  Not Found [IP: 185.199.108.153 443]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:6 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [322 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:10 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [4644 B]
Get:11 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [142 kB]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [344 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [363 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [275 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [655 kB]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [7791 B]
Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [3175 B]
Get:20 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [7275 B]
Reading package lists...
E: The repository 'https://cli.github.com/packages jammy Release' does not have a Release file.
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
1+0 records in
1+0 records out
32 bytes copied, 5.2568e-05 s, 609 kB/s

It might be something wrong with the configurations.

Any ideas.

Where did you file that Dockerfile? From the error, I think it might be the same as here https://www.reddit.com/r/Ubuntu/comments/vtqf4o/the_repository_httpscligithubcompackages_jammy/ .

The Dockerfile is from the following repository: GitHub - aneeqzia-isi/surgtoolloc2022-category-1: A repo with example algorithm submission container for surgtoolloc 2022 participating teams.. This is a competition for which I am trying to make a submission. Instead of using the pyTorch/pytorch image, I have replaced it with the fastai/fastai image. But it seems a bit tougher with docker and fastai together as I am not very good with docker commands.

Thanks for sharing the link for the error. It seems like the same error but doesn’t know how to find the PPA name and remove it from the Dockerfile.

The following script eventually worked for me:

FROM nvidia/cuda:11.3.1-base-ubuntu20.04
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    git \
    curl

# get miniconda
# this yields strange warnings, but ultimately works
RUN curl -fsSL -v -o ~/miniconda.sh -O  "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"

# install miniconda
# install conda dependencies. Adjust as neccesary
RUN chmod +x ~/miniconda.sh && \
    ~/miniconda.sh -b -p /opt/conda && \
    /opt/conda/bin/conda install -y python=3.10 && \
    /opt/conda/bin/conda install -y pytorch=1.11.0 torchvision=0.12.0 torchaudio=0.11.0 cudatoolkit=11.3 -c pytorch

ENV PATH=/opt/conda/bin:$PATH

RUN conda install -c fastchan fastai

RUN groupadd -r algorithm && useradd -m --no-log-init -r -g algorithm algorithm

RUN mkdir -p /opt/algorithm /input /output /images /test /opt/algorithm/models \
    && chown algorithm:algorithm /opt/algorithm /input /output /images /test /opt/algorithm/models /opt/conda

RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y ffmpeg libsm6 libxext6 --no-install-recommends

USER algorithm

WORKDIR /opt/algorithm

ENV PATH="/home/algorithm/.local/bin:${PATH}"

RUN python -m pip install --user -U scikit-image

COPY --chown=algorithm:algorithm requirements.txt /opt/algorithm/

RUN python -m pip install --user -rrequirements.txt

COPY --chown=algorithm:algorithm process.py /opt/algorithm/

COPY --chown=algorithm:algorithm ml_utils.py /opt/algorithm/

COPY --chown=algorithm:algorithm test/ /input/

COPY --chown=algorithm:algorithm output/ /output/

COPY --chown=algorithm:algorithm models/ /opt/algorithm/models/

ENTRYPOINT python -m process $0 $@

Thought someone might need it or comment if I am doing anything wrong.

Happy learning.