-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e9914e4
commit c424f81
Showing
14 changed files
with
429 additions
and
67 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,7 @@ | ||
python API | ||
=========== | ||
|
||
.. automodule:: cesm | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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
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
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 |
---|---|---|
@@ -1,117 +1,116 @@ | ||
### Install Docker and pull container | ||
### Install Docker and pull the container | ||
#### Check system info | ||
We need to get familiar with our computer system before the next steps. | ||
First of all, get familiar with our computer system before the next steps. Noted that the commands below run in Linux. | ||
``` | ||
lsb_release -a | ||
#LSB Version: :core-4.1-amd64:core-4.1-noarch | ||
#LSB Version: core-4.1-amd64:core-4.1-noarch | ||
#Distributor ID: CentOS | ||
#Description: CentOS Linux release 7.9.2009 (Core) | ||
#Release: 7.9.2009 | ||
#Codename: Core | ||
``` | ||
#### Install docker | ||
|
||
For CentOS, using yum to install packages. | ||
Use **yum** to install packages in CentOS. | ||
|
||
``` | ||
# 1 Make your packages upadted, if needed. | ||
# 1 Make your packages updated, if needed. | ||
sudo yum makecache fast | ||
# 2 install docker dependences | ||
# 2 Install docker dependences | ||
sudo yum install -y yum-utils device-mapper-persistent-data lvm2 | ||
# 3 add docker repo | ||
# 3 Add docker repo | ||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | ||
# 4 install docker | ||
# 4 Install docker | ||
sudo yum install -y docker-ce docker-ce-cli containerd.io | ||
# 5 start docker | ||
# 5 Start docker | ||
sudo systemctl start docker | ||
# 6 set Docker to boot automatically | ||
# 6 Set Docker to boot automatically | ||
sudo systemctl enable docker | ||
# Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. | ||
# 7 check docker | ||
# 7 Check docker | ||
sudo docker --version | ||
# Docker version 24.0.6, build ed223bc | ||
# 8 for more docker info | ||
# 8 Check more docker info | ||
docker info | ||
# 9 We can reset the Docker Root Dir (/var/lib/docker, for default) | ||
sudo systemctl stop docker # stop docker | ||
sudo systemctl stop docker # stop docker | ||
sudo mkdir -p your_loc/docker/storage # create docker dir | ||
sudo mkdir -p your_loc/docker/storage # create docker dir | ||
cat /etc/docker/daemon.json # check the docker configuration | ||
cat /etc/docker/daemon.json # check the docker configuration | ||
# if not exsit /etc/docker/daemon.json | ||
# create a json file using vi/vim or nona | ||
#{ | ||
# "data-root": "/datadisk/docker/storage" | ||
#} | ||
# if not exsit /etc/docker/daemon.json | ||
# create a json file using vi/vim or nona | ||
#{ | ||
# "data-root": "/datadisk/docker/storage" | ||
#} | ||
sudo systemctl start docker # reopen docker | ||
docker info # check docker configuration | ||
sudo systemctl start docker # reopen docker | ||
docker info # check docker configuration | ||
``` | ||
#### Pull the ctsm env image | ||
#### Pull the clm env image | ||
https://hub.docker.com/, the official sources of docker images. | ||
|
||
|
||
``` | ||
docker pull clmu-container # pull the image | ||
docker pull installed in clmu-app # pull the image | ||
``` | ||
|
||
#### Biuld container | ||
#### Build container (installed in clmu-app) | ||
|
||
``` | ||
# case and inputdata dir | ||
mkdir -vp p/project p/scratch/CESMDATAROOT/inputdata/ForcingData p/pyscripts | ||
# do not change the hostname | ||
docker run --hostname clm5-docker --name clm5.0 -it --mount type=bind,source="$(pwd)"/p,target=/p clm5docker:1 | ||
# Do not change the hostname | ||
docker run --hostname clmu-app --name ContainerName -it clmu-app:1 | ||
``` | ||
|
||
#### Install CTSM or CLM5.0 | ||
#### Install CLM5.0 (installed in clmu-app) | ||
``` | ||
# in container | ||
# In the container directory | ||
cd /p/project | ||
git clone -b release-clm5.0 https://github.com/ESCOMP/CTSM.git clm5.0 | ||
cd clm5.0 | ||
./manage_externals/checkout_externals | ||
# Check if all components needed are downloaded | ||
./manage_externals/checkout_externals -S | ||
``` | ||
|
||
If you need to change the config of CTSM, please refer to [key notes for seting config_manchine.xml](https://bb.cgd.ucar.edu/cesm/threads/issue-installing-on-centos-8-with-slurm-and-lmod.5884/#post-39110) | ||
If you want to modify model configuration, please refer to [key notes for setting config_manchine.xml](https://bb.cgd.ucar.edu/cesm/threads/issue-installing-on-centos-8-with-slurm-and-lmod.5884/#post-39110). | ||
|
||
#### Singularity | ||
|
||
Singularity is a container software ususally empoly in HPC. It provides a mechanism to run containers where containers can be used to package entire scientific workflows, software and libraries, and even data. | ||
Singularity is a container software usually employed in HPC. It provides a mechanism to run containers where containers can be used to package entire scientific workflows, software and libraries, and even data. | ||
Ref: https://ri.itservices.manchester.ac.uk/csf3/software/applications/singularity/ | ||
|
||
Using Singularity from docker image | ||
Using Singularity from the docker image | ||
|
||
``` | ||
# save image as tar file | ||
# Save image as tar file | ||
docker save -o ~/docker/clm5docker.tar clm5docker:1 | ||
# transport tar file | ||
# Transport tar file | ||
scp ~/docker/clm5docker.tar ... | ||
# biuld image form tar | ||
# Biuld image form tar | ||
singularity build clm5docker.sif docker-archive://clm5docker.tar | ||
scp /Users/user/Documents/GitHub/DRL_urban_climate_adaptation/2_CTSM_container/dockerfile/cime_config/config_machines.xml [email protected]:~/.cime | ||
scp /Users/user/Documents/GitHub/DRL_urban_climate_adaptation/2_CTSM_container/dockerfile/cime_config/config_compilers.xml [email protected]:~/.cime | ||
mkdir -vp p/project p/scratch/CESMDATAROOT/inputdata | ||
singularity run --hostname clm5-docker -B "$(pwd)"/p:/p clm5docker.sif # do not change hostname, either need to change cime.config file | ||
singularity run --net --network=none --hostname clm5-docker -B "$(pwd)"/p:/p clm5docker.sif | ||
singularity run --hostname clmu-app -B "$(pwd)"/p:/p clm5docker.sif | ||
# Do not change hostname, either need to change cime.config file | ||
# then in singularity, as singularity are not same as | ||
# CLM5 environment variables | ||
singularity run --net --network=none --hostname clmu-app -B "$(pwd)"/p:/p clm5docker.sif | ||
# Export CLM5 environment variables | ||
export PROJECT=/p/project | ||
export SCRATCH=/p/scratch | ||
export BUDGET_ACCOUNTS=slts | ||
|
@@ -123,10 +122,10 @@ export OMPI_ALLOW_RUN_AS_ROOT=1 | |
``` | ||
|
||
#### Tips for docker commander | ||
- docker ps:check for the running container | ||
- docker stop <container-id>:stop the container | ||
- docker start <container-id>:start the container | ||
- docker restart <container-id>:restart the container | ||
- docker rm <container-id>:remove a container | ||
- docker logs <container-id>:check the logs | ||
- docker exec -it <container-id> /bin/bash:get into a running docker container with Bash shell. | ||
- docker ps: check for the running container | ||
- docker stop <container-id>: stop the container | ||
- docker start <container-id>: start the container | ||
- docker restart <container-id>: restart the container | ||
- docker rm <container-id>: remove a container | ||
- docker logs <container-id>: check the logs | ||
- docker exec -it <container-id> /bin/bash: get into a running docker container with Bash shell |
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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
### CLM ENV Container detail | ||
|
||
OS=`Fedora 31` | ||
Base: | ||
|
||
- OS=`Fedora 31` | ||
|
||
Major apps: | ||
Compiler= `GCC 9.3.1` | ||
Mpi=`OpenMPI 4.0.2-1`, Cmake=`3.18`, pnetcdf=`1.12.3`, netcdf-c=`4.7.0-2`, netcdf-fortran=`4.5.2-3`, python=`3.7.9`, svn=`1.12` | ||
- Compiler= `GCC 9.3.1` | ||
- Cmake=`3.18` | ||
- netcdf-c=`4.7.0-2` | ||
- netcdf-fortran=`4.5.2-3` | ||
- python=`3.7.9` | ||
- svn=`1.12` | ||
|
||
![Alt text](fig/ENV.png "CLMU") | ||
<center>CMLU container environment.</a></center> |
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
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 @@ | ||
# Wrokflow of cesm.py: Python API for driving clmu-app single point modeling | ||
|
||
![Alt text](fig/cesmpy.jpg "cesmpy") | ||
<center>cesm Python API.</center> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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 @@ | ||
scr | ||
=== | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
cesm |
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ ipython | |
nbsphinx | ||
sphinx_rtd_theme | ||
recommonmark | ||
sphinx-markdown-tables | ||
sphinx-markdown-tables | ||
xarray | ||
numpy |
Oops, something went wrong.