Skip to content

Commit

Permalink
Remove local julia env (#38)
Browse files Browse the repository at this point in the history
* Use `askem-julia`

* Use latest

* Fix references in Docker

* Update README

* Change 'Subkernel' -> 'subkernel'

* Remove unnecessary lines from Dockerfile

* Consolidate redundant copies

* Remove unnecessary chowns
  • Loading branch information
fivegrant authored Dec 5, 2023
1 parent d8a4e06 commit 862c22b
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 2,792 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG JULIA_IMAGE=askem-julia-base
FROM ${JULIA_IMAGE} AS JULIA_BASE_IMAGE
FROM ghcr.io/darpa-askem/askem-julia:latest AS JULIA_BASE_IMAGE


FROM python:3.10
Expand All @@ -9,15 +8,13 @@ RUN mkdir -p /usr/local/share/jupyter/kernels && chmod -R 777 /usr/local/share/j

ENV JULIA_PATH=/usr/local/julia
ENV JULIA_DEPOT_PATH=/usr/local/julia
ENV JULIA_PROJECT=/home/jupyter/.julia/environments/v1.9
ENV JULIA_PROJECT=/home/jupyter/.julia/environments/askem

COPY --from=JULIA_BASE_IMAGE /usr/local/julia /usr/local/julia
COPY --from=JULIA_BASE_IMAGE /ASKEM-Sysimage.so /usr/local/julia/lib/ASKEM-Sysimage.so
COPY --chown=1000:1000 --from=JULIA_BASE_IMAGE /usr/local/julia /usr/local/julia
COPY --chown=1000:1000 --from=JULIA_BASE_IMAGE /ASKEM-Sysimage.so /Project.toml /Manifest.toml /home/jupyter/.julia/environments/askem/
RUN chmod -R 777 /usr/local/julia/logs
RUN ln -sf /usr/local/julia/bin/julia /usr/local/bin/julia

COPY --chown=1000:1000 environments/julia /home/jupyter/.julia/environments/v1.9

WORKDIR /home/jupyter

# Install r-lang and kernel
Expand Down Expand Up @@ -58,7 +55,7 @@ COPY --chown=1000:1000 . /jupyter
USER jupyter

# Install Julia kernel
RUN /usr/local/julia/bin/julia -J /usr/local/julia/lib/ASKEM-Sysimage.so -e 'using IJulia; IJulia.installkernel("julia"; julia=`/usr/local/julia/bin/julia -J /usr/local/julia/lib/ASKEM-Sysimage.so --threads=4`)'
RUN /usr/local/julia/bin/julia -J /home/jupyter/.julia/environments/askem/ASKEM-Sysimage.so -e 'using IJulia; IJulia.installkernel("julia"; julia=`/usr/local/julia/bin/julia -J /home/jupyter/.julia/environments/askem/ASKEM-Sysimage.so --threads=4`)'

# Service
CMD ["python", "service/main.py", "--ip", "0.0.0.0"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ $ make dev

This will start the Jupyter service and launch a specialized notebook interface in your browser similar to if you ran `$ jupyter notebook` normally.

## Julia Subkernel Packages

The Julia subkernel is managed by [`askem-julia`](https://github.com/DARPA-ASKEM/askem-julia). To make a new package
available to Beaker, it must be added to `askem-julia`'s `Project.toml`.


## Differences from vanilla Jupyter

Expand Down
15 changes: 1 addition & 14 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function "check_suffix" {
# ----------------------------------------------------------------------------------------------------------------------

group "prod" {
targets = ["beaker-kernel", "askem-julia-base"]
targets = ["beaker-kernel"]
}

group "default" {
Expand All @@ -46,23 +46,10 @@ target "_platforms" {
platforms = ["linux/amd64"]
}

target "askem-julia-base" {
inherits = ["_platforms"]
context = "environments/julia/"
tags = tag("askem-julia-base", "", "")
dockerfile = "Dockerfile"
}

target "beaker-kernel-base" {
contexts = {
askem-julia-base = "target:askem-julia-base"
}
context = "."
tags = tag("beaker-kernel", "", "")
dockerfile = "Dockerfile"
args = {
JULIA_IMAGE = "askem-julia-base"
}
}

target "beaker-kernel" {
Expand Down
8 changes: 0 additions & 8 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

version: '3'
services:
julia-base-image:
image: askem-julia-base:build
build:
context: environments/julia
command: ["/bin/true"]

jupyter:
build:
dockerfile: Dockerfile
Expand All @@ -27,8 +21,6 @@ services:
volumes:
- ./beaker_kernel:/usr/local/share/jupyter/kernels/beaker_kernel
- .:/jupyter
depends_on:
- julia-base-image
command: ["python", "service/dev.py", "--ip", "0.0.0.0", "-y"]

data-service:
Expand Down
23 changes: 0 additions & 23 deletions environments/julia/Dockerfile

This file was deleted.

Loading

0 comments on commit 862c22b

Please sign in to comment.