Read me to walk through the tech demo and better explain what is going on
- Downloading the LMR Turbo model
a. $ sudo wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
b. $ sudo chmod +x Miniconda3-latest-*.sh && ./Miniconda3-latest-*.sh
c. export PATH="~/miniconda3/bin:$PATH" . ~/miniconda3/etc/profile.d/conda.sh
d. $ source ~/.bashrc
e. $ which conda
f. $ conda create -n LMRt python=3.8
g. $ If HTTP error, $ conda update conda
h. $ conda activate LMRt
i. $ conda install -c conda-forge cartopy pyspharm jupyterlab
j. $ pip install LMRt
k. $ sudo apt-get update && sudo apt-get upgrade
l. https://drive.google.com/drive/folders/1UGn-LNd_tGSjPUKa52E6ffEM-ms2VD-N
m. Extract into Downloads directory
n. $ mkdir testcases
o. $ mv Downloads/PAGES2k_CCSM4_GISTEMP testcases/PAGES2k_CCSM4_GISTEMP
q. $ jupyter notebook
r. Run file, then exit Jupyter Notebook
s. $ conda deactivate
- Download Ubuntu image from Dockerhub
a. $ sudo apt-get update
b. $ sudo apt-get install ca-certificates curl gnupg lsb-release
c. $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
d. $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
e.* For Linux Mint
$ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ xenial \ stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
* For Ubuntu Impish 21.10, Ubuntu Hirsute 21.04, Ubuntu Focal 20.04 (LTS),
Ubuntu Bionic 18.04 (LTS)
$ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
f. $ sudo apt-get update
g. $ apt-cache policy docker-ce
h. $ sudo apt-get install docker-ce docker-ce-cli containerd.io
i. $ sudo groupadd docker
j. $ sudo usermod -aG docker mumbi
k. $ newgrp docker
l. $ docker run hello-world
m. docker pull ubuntu
- Create Dockerfile for LMR Turbo model
a. $ nano Dockerfile
FROM ubuntu
COPY
- Create the image of LMR Turbo
a. docker pull mumbimamb/fossilizedcontainers:latest takes a bit of time
- From the image, run the LMR Turbo model in a container
a. docker run -i -t mumbimamb/fossilizedcontainers bash
- Check that the container is running properly (Docker containers command)
b. docker run -p 8888:8888
- View the model
a. $ jupyter notebook --allow-root
b. Run all
- Exit the model
a. Exit jupyter notebook
b. $ conda deactivate
$ conda deactivate
- Stop and delete the container
a. exit
b. docker container ls -a
c. docker rm
- Recreate the container from the already created image
a. docker build -t osboxes/lmrt .
Challenges addressed: Installing the CLI, user prompts for CLI, containerization, and documentation
- Download the file titled "presto-0.0.1-py3-none-any.whl" from presto/dist. You can use the following command on linux to download it
wget https://github.com/FossilizedContainers/tech-demo/raw/master/presto/dist/presto-0.0.1-py3-none-any.whl
cd
into the folder containing the wheel distribution file- Run the following command to install the presto package
$ pip install presto-0.0.1-py3-none-any.whl
- Run the following command
$ presto create
-
Enter the OS you would like your container to use
-
Enter the message you would like to display
-
View the dockerfile created
- Example of a dockerfile:
FROM alpine CMD ["echo", "Hello World!"]
-
Download the demonstration Dockerfile from our github.
wget https://raw.githubusercontent.com/FossilizedContainers/tech-demo/master/C4/Dockerfile
-
Run the following command
presto run
-
You should have seen your container running
- Example output:
Building image from Dockerfile... Finished building image... Running the container... Hello World!
-
Now run the following command to clean up the container to free up resources
presto clean
- Go into the folder for Demonstration 3:
cd demo3/
- Start the Python server. This is what will receive the LiPD files and send back the NetCDF files.
python3 ./server.py
- Start the Python client. This is what will send the LiPD files / Climate Model Parameters and receive the resulting NetCDF file.
python3 ./client.py
- Verify the files have been properly sent and received.