I am trying to create a CI system using Github Actions for ChAI. It seems like it would be best to use Docker for this. The tests include numerical correspondence with functions in PyTorch. Therefore, the environment needs to have Chapel, as well as a Python + PyTorch installation. What would be the best way to have one Dockerfile that gives me this?
I think the easiest way would be to write a Dockerfile FROM
chapel/chapel
, and then add your additional requirements. It comes with python3
as that's a Chapel dependency, so all you need to add is installing PyTorch with pip
or however else.
Hi Iain,
If you are going to use a Docker file I agree with Anna's suggestions.
I just got Chapel working in Gradescope without pulling from Docker. I couldn't do that because it would be too slow to pull the docker container everytime one of the students submits an assignment.
Gradescope uses a base of Ubuntu 22.04. And then I had my bash setup script do the following:
apt install -y /autograder/source/chapel-2.3.0-1.ubuntu22.amd64.deb
See the Linux package managers at Downloading Chapel to get the .deb file.
Please let us know what works!!
Hi Michelle,
Thank you for your suggestion, it worked perfectly!
This is what I did:
FROM ubuntu:22.04
RUN apt update && apt upgrade -y > /dev/null
COPY deb /
RUN (apt install -y ./chapel-2.3.0-1.ubuntu22.arm64.deb > /dev/null) || (apt install -y ./chapel-2.3.0-1.ubuntu22.amd64.deb > /dev/null)
RUN apt install -y python3-pip > /dev/null
RUN pip3 install numpy torch torchvision > /dev/null
COPY lib /lib
COPY examples /examples
COPY test /test
# Run tests
RUN cd test/correspondence && python3 correspondence.py
Is there a general form that the chapel release urls take so that I can wget them instead of bundling them in my library?
I believe Michelle was referring to an alternative route if you would like to avoid the use of Docker for performance/bandwidth, as she did in her use case.
If you are okay with using Docker, it would save some complexity to base your image off the existing Chapel image rather than needing to fetch the latest .deb
and store it somewhere each time you want to build a new image.
Then the equivalent to your above Dockerfile would be:
FROM chapel/chapel:latest
RUN pip3 install numpy torch torchvision > /dev/null
COPY lib /lib
COPY examples /examples
COPY test /test
# Run tests
RUN cd test/correspondence && python3 correspondence.py
To answer your direct question, the Chapel release artifacts have more predictable links found on the Github release pages, see for example Release Chapel 2.3.0 Release (Winter 2024) · chapel-lang/chapel · GitHub; the one you were using is at https://github.com/chapel-lang/chapel/releases/download/2.3.0/chapel-2.3.0-1.ubuntu22.arm64.deb.