-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] Preliminary Ubuntu 20.04 images for both CPU and GPU as well as docs #312
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="MIT Probabilistic Computing Project" | ||
|
||
# Find current Julia version on https://julialang.org/downloads/ | ||
ARG JULIA_VERSION_SHORT="1.5" | ||
ARG JULIA_VERSION_FULL="${JULIA_VERSION_SHORT}.1" | ||
ENV JULIA_INSTALLATION_PATH=/opt/julia | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV JULIA_INSTALLATION_PATH=/opt/julia | ||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -qq -y --no-install-recommends\ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
graphviz \ | ||
hdf5-tools \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-tk \ | ||
rsync \ | ||
software-properties-common \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* && \ | ||
ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_VERSION_SHORT}/julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
tar zxf julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
mkdir -p "${JULIA_INSTALLATION_PATH}" && \ | ||
mv julia-${JULIA_VERSION_FULL} "${JULIA_INSTALLATION_PATH}/" && \ | ||
ln -fs "${JULIA_INSTALLATION_PATH}/julia-${JULIA_VERSION_FULL}/bin/julia" /usr/local/bin/ && \ | ||
rm julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
julia -e 'import Pkg; Pkg.add("IJulia")' | ||
|
||
RUN julia -e 'import Pkg; Pkg.add(["Gen"])' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu20.04 | ||
|
||
LABEL maintainer="MIT Probabilistic Computing Project" | ||
|
||
# Find current Julia version on https://julialang.org/downloads/ | ||
ARG JULIA_VERSION_SHORT="1.5" | ||
ARG JULIA_VERSION_FULL="${JULIA_VERSION_SHORT}.1" | ||
ENV JULIA_INSTALLATION_PATH=/opt/julia | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate - see line 11. |
||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV JULIA_INSTALLATION_PATH=/opt/julia | ||
|
||
RUN apt-get update -qq \ | ||
&& apt-get install -qq -y --no-install-recommends\ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
graphviz \ | ||
hdf5-tools \ | ||
python3-dev \ | ||
python3-pip \ | ||
python3-tk \ | ||
rsync \ | ||
software-properties-common \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* && \ | ||
ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_VERSION_SHORT}/julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
tar zxf julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
mkdir -p "${JULIA_INSTALLATION_PATH}" && \ | ||
mv julia-${JULIA_VERSION_FULL} "${JULIA_INSTALLATION_PATH}/" && \ | ||
ln -fs "${JULIA_INSTALLATION_PATH}/julia-${JULIA_VERSION_FULL}/bin/julia" /usr/local/bin/ && \ | ||
rm julia-${JULIA_VERSION_FULL}-linux-x86_64.tar.gz && \ | ||
julia -e 'import Pkg; Pkg.add("IJulia")' | ||
|
||
RUN julia -e 'import Pkg; Pkg.add(["Gen"])' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Gen Containerization | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps rather than in its own markdown file, this should be added as a subsection at the bottom of |
||
|
||
## Quickstart | ||
|
||
### Docker Setup | ||
Please follow the [official Docker installation instructions](https://docs.docker.com/engine/install/) to setup Docker on your target platform. If you would like to use GPU acceleration, please also install the [NVIDIA Container Toolkit / nvidia-docker](https://github.com/NVIDIA/nvidia-docker). | ||
|
||
|
||
### Building Container | ||
You can build Docker containers for Gen that either target CPU-only or GPU-enabled machines. | ||
- Please run `docker build -f docker/GenCPU.dockerfile -t gen:cpu-ubuntu20.04 .` for the CPU image | ||
- Please run `docker build -f docker/GenGPU.dockerfile -t gen:gpu-ubuntu20.04 .` if you want to use GPU acceleration | ||
Both commands are supposed to be run from the main Gen.jl folder, not this subfolder. | ||
Comment on lines
+9
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we should have the "easy version" be to pull a pre-built image from Docker Hub, and have building the container on one's own be the "advanced version"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely, I just lack access rights to do that for you. But I would highly recommend that as well. |
||
|
||
### Running Container | ||
You can run `docker run -it gen:cpu-ubuntu20.04 bash` to run the CPU image and `docker run -it --gpus all gen:gpu-ubuntu20.04 bash` to run the GPU image. Afterwards, you can just execute `julia`, type `using Gen` and start developing with Gen. If you would like to remove the container, please add the flag `--rm` to your run command. | ||
|
||
## Known Issues | ||
|
||
### Run or Build Script Not Executable | ||
If you get an error like | ||
``` | ||
bash: ./docker_build_gpu.sh: Permission denied | ||
``` | ||
Then please make the script executable via `chmod +x docker_build_gpu.sh` (analogous for CPU). | ||
|
||
### Known Issues with Docker on macOS | ||
The Docker container might currently fail on macOS with the following error: | ||
``` | ||
julia> using Gen | ||
[ Info: Precompiling Gen [ea4f424c-a589-11e8-07c0-fd5c91b9da4a] | ||
ERROR: Failed to precompile Gen [ea4f424c-a589-11e8-07c0-fd5c91b9da4a] to /root/.julia/compiled/v1.4/Gen/OEZG1_t5nDi.ji. | ||
Stacktrace: | ||
[1] error(::String) at ./error.jl:33 | ||
[2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1272 | ||
[3] _require(::Base.PkgId) at ./loading.jl:1029 | ||
[4] require(::Base.PkgId) at ./loading.jl:927 | ||
[5] require(::Module, ::Symbol) at ./loading.jl:922 | ||
``` | ||
|
||
This can even happen when running inside a VM on macOS. While this bug is confirmed and reproducable, there is currently no solution for it, cmp. [issue 311](https://github.com/probcomp/Gen.jl/issues/311). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo - should be "reproducible" |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate - see line 11.