-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM docker.io/julia:latest@sha256:32b91d5ff59276c5986b9b35b76b232651d71e8273dcf22ead1593a960ce816e | ||
|
||
ENV JULIA_DEPOT_PATH=/home/ces-user/.julia | ||
|
||
USER root | ||
RUN mkdir /safe_data /safe_outputs /scratch | ||
|
||
WORKDIR /app | ||
|
||
COPY --chmod=0755 src/* . | ||
|
||
RUN julia /app/install_packages.jl | ||
|
||
ENTRYPOINT ["/app/run_test.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# TRE Julia example | ||
|
||
## Notes | ||
|
||
This example is structured as a script `plot_example.jl` that generates a plot, and a bash script `run_test.sh` that executes the plot script and saves the output to `/safe_outputs`. Both files are found under the `src` directory, which is copied inside the container in the `Dockerfile`. | ||
|
||
The required packages are installed using the `install_packages.jl` script. Note that it is important to set the `ENV JULIA_DEPOT_PATH` to ensure the packages are installed in the same environment as where the scripts are to be executed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Pkg | ||
|
||
Pkg.add(["GR", "Plots"]) | ||
Pkg.precompile() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Plots | ||
|
||
# plot some data | ||
plot([cumsum(rand(500) .- 0.5), cumsum(rand(500) .- 0.5)]) | ||
|
||
# save the current figure | ||
savefig("plots.svg") | ||
# .eps, .pdf, & .png are also supported | ||
# we used svg here because it respects the width and height specified above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Run example script | ||
julia plot_example.jl | ||
|
||
# Copy output to /safe_outputs | ||
mv *.svg /safe_outputs |