Skip to content

Commit

Permalink
fix: Update script to install packages (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwerner authored Aug 21, 2024
1 parent 2c3498b commit e8c3e5b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 199 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ HADOLINT="${HOME}/hadolint"
help:
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
# http://github.com/jupyter/docker-stacks
@echo "illumidesk/umich-stacks"
@echo "illumidesk/illumidesk-stacks"
@echo "====================="
@echo "Replace % with a stack directory name (e.g., make build/umich-notebook)"
@echo "Replace % with a stack directory name (e.g., make build/python-notebook)"
@echo
@grep -E '^[a-zA-Z0-9_%/-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![Test Docker Image Status](https://github.com/illumidesk/umich-stacks/workflows/Test%20and%20Push/badge.svg)](https://github.com/illumidesk/umich-stacks/actions?query=branch%3Amain+workflow%3A%22Test+and+Push%22)
[![Test Docker Image Status](https://github.com/illumidesk/illumidesk-stacks/workflows/Test%20and%20Push/badge.svg)](https://github.com/illumidesk/illumidesk-stacks/actions?query=branch%3Amain+workflow%3A%22Test+and+Push%22)


# IllumiDesk Docker Stacks for the University of Michigan
# IllumiDesk Docker Stacks

This repo is used to manage University of Michigan's docker images for the IllumiDesk learning environment integrated with the Canvas LMS.
This repo is used to manage IllumiDesk's standard docker images for the IllumiDesk learning environment to power Jupyter Server backends.

## Pre Requisits

Expand All @@ -28,7 +28,7 @@ make build-all
Running the image standalone is helpful for testing:

```bash
docker run -p 8888:8888 illumidesk/umich-notebook:latest
docker run -p 8888:8888 illumidesk/python-notebook:latest
```

Then, navigate to `http://127.0.0.1:8888` to access your Jupyter Notebook server.
Expand All @@ -37,19 +37,24 @@ Then, navigate to `http://127.0.0.1:8888` to access your Jupyter Notebook server
## Customize the Image

1. Add additional Julia packages by editing the `./umich-notebook/install-julia-packages.bash` file.
1. Add additional Python packages by editing the `./python-notebook/requirements.txt` file.

2. Rebuild end-user and grader images with `make build-all`.

3. (Optional) Push images to DockerHub
3. Push images to AWS ECR

- [You must first authenticate](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html) to push to AWS ECR repos using `docker` coomands.
- Run `docker push <repo>` where `<repo>` represents the full path to your AWS ECR repository.

1. (Optional) Push images to DockerHub

This step requires creating an Organization account in DockerHub or other docker image compatible registry. The `docker push ...` command will push the image to the DockerHub registry by default. Please refer to the official Docker documentation if you would like to push another registry.

For example, assuming the DockerHub organization is `illumidesk`, the source files are in the `umich-notebook` folder, and the tag is `latest`, then the full namespace for the image would be `illumidesk/umich-notebook:latest`. Assuming the image has been built, push the image to DockerHub or any other docker registry with the `docker push <image-namespace>:<image-tag>` command:
For example, assuming the DockerHub organization is `illumidesk`, the source files are in the `python-notebook` folder, and the tag is `latest`, then the full namespace for the image would be `illumidesk/python-notebook:latest`. Assuming the image has been built, push the image to DockerHub or any other docker registry with the `docker push <image-namespace>:<image-tag>` command:

```bash
docker login
docker push illumidesk/umich-notebook:latest
docker push illumidesk/python-notebook:latest
```

## Development and Testing
Expand Down
21 changes: 6 additions & 15 deletions umich-notebook/Dockerfile → python-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@
# https://github.com/jupyter/docker-stacks/blob/main/images/julia-notebook
ARG REGISTRY=quay.io
ARG OWNER=jupyter
ARG BASE_CONTAINER=$REGISTRY/$OWNER/minimal-notebook
FROM $BASE_CONTAINER
ARG BASE_CONTAINER=$REGISTRY/$OWNER/datascience-notebook
FROM ${BASE_CONTAINER}

# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

USER root

# Julia dependencies
# install Julia packages in /opt/julia instead of ${HOME}
ENV JULIA_DEPOT_PATH=/opt/julia \
JULIA_PKGDIR=/opt/julia

# Setup Julia
RUN /opt/setup-scripts/setup_julia.py

USER ${NB_UID}

# Setup IJulia kernel & other packages
RUN /opt/setup-scripts/setup-julia-packages.bash
COPY --chown=${NB_UID}:${NB_GID} requirements.txt "${HOME}/requirements.txt"
WORKDIR "${HOME}"
RUN pip install -r requirements.txt

RUN pip install jupyter_kernel_gateway psycopg2-binary

WORKDIR "${HOME}"

CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip=0.0.0.0", "--KernelGatewayApp.port=8888"]
CMD ["jupyter", "kernelgateway", "--KernelGatewayApp.ip=0.0.0.0", "--KernelGatewayApp.port=8888"]
18 changes: 18 additions & 0 deletions python-notebook/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
psycopg2-binary
gpt4all
jupyter_kernel_gateway
langchain
langchain.tools
langchain_openai
langchain_text_splitters
llmlingua
networkx
nltk
openai
pdfplumber
pymupdf
pypdf
pdf2image
poppler-utils
reportlab
requests
77 changes: 0 additions & 77 deletions umich-notebook/setup-scripts/install-julia-packages.bash

This file was deleted.

97 changes: 0 additions & 97 deletions umich-notebook/setup-scripts/setup_julia.py

This file was deleted.

0 comments on commit e8c3e5b

Please sign in to comment.