Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploying IMI on a local workstation(not cluster) #294

Open
doudouwa002 opened this issue Dec 7, 2024 · 5 comments
Open

deploying IMI on a local workstation(not cluster) #294

doudouwa002 opened this issue Dec 7, 2024 · 5 comments
Assignees

Comments

@doudouwa002
Copy link

Name and Institution (Required)

Name: Chen Xiaodong
Institution: University of Science and Technology of China

Description of your issue or question


Hello,
I’m currently trying to deploy the IMI Docker on my local workstation. My workstation is running Ubuntu 22.04, which is a recently installed and fairly clean system. However, I’m encountering issues with the GEOS-Chem environment setup, and I have several questions about how to proceed. I’m a beginner and would greatly appreciate guidance from experts in this area! If you happen to read this and can offer advice or answer any of my questions, I would be very grateful:


1. Docker Issue

When I run docker compose up to start the container, I encounter the following error:

* Starting MUNGE munged  
   ...done.  
* Starting slurm central management daemon slurmctld  
   ...done.  
* Starting slurm compute node daemon slurmd  
   ...done.  
Overriding config variables in /home/ubuntu/integrated_methane_inversion/config.yml with environment variables.  
No config variables overridden.  

=== PARSING CONFIG FILE (run_imi.sh) ===  

Activating conda environment: imi_env  

GEOS-Chem environment file  does not exist!  
IMI Test_Permian_1week Aborted  

I’m using the following image:
public.ecr.aws/w1q7j9l2/imi-ubuntu-docker-image:imi-2.0.1.

Here’s my compose.yml file:

services:  
  imi:  
    image: public.ecr.aws/w1q7j9l2/imi-ubuntu-docker-image:imi-2.0.1  

    volumes:  
      - /home/ustcpolar/Documents/imi_container/config.yml:/home/ubuntu/integrated_methane_inversion/config.yml # mount desired config file  
      - /home/ustcpolar/Documents/imi_container/imi_output:/home/ubuntu/imi_output_dir # mount output directory  
    environment:  
      - IMI_CONFIG_PATH=/home/ubuntu/integrated_methane_inversion/config.yml  

The error seems related to the GEOS-Chem environment file, which I understand I need to configure myself. However, I’m unsure how to configure it or what specifically to modify. I noticed there are four GEOS-Chem environment templates for the Harvard-Cannon cluster version, but I'm not sure which of the templates should I base my configuration on for a standalone workstation? They don’t seem suited to a standalone workstation like mine. Could you share an example template tailored for an independent workstation? Once I have the environment file, how should I integrate it? Do I simply include it in compose.yml like what we do with the config.yml? Are there any other considerations or specific steps I should take to successfully deploy the IMI Docker on a local workstation? Or, could you give an instruction on the deploy of IMI on an independent workstation ?


2. Suitability of My Workstation

Given the specifications of my workstation, do you think it’s reasonable to run IMI on it? Is it capable of handling the workload, or is it too limited to run IMI effectively?

Additionally, if I run IMI locally, will the container automatically download the required datasets (e.g., satellite data, meteorological data, boundary conditions) from AWS?

Here are my workstation specifications:

CPU:

Model name: Intel(R) Xeon(R) Platinum 8276 CPU @ 2.20GHz  
CPU series: 6  
Model: 85  
Thread(s) per core: 2  
Core(s) per socket: 28  
Sockets: 2  
Stepping: 7  
Max MHz: 4000.0000  
Min MHz: 1000.0000  
BogoMIPS: 4400.00  

Memory:

$ free -h  
              total        used        free      shared  buff/cache   available  
Mem:        251Gi       9.4Gi       193Gi       156Mi        48Gi       240Gi  
Swap:       2.0Gi          0B       2.0Gi  

Storage:

A 3.6TB hard drive.

GPU:

$ nvidia-smi  
Sat Dec  7 22:34:16 2024  
+---------------------------------------------------------------------------------------+  
| NVIDIA-SMI 535.183.01             Driver Version: 535.183.01   CUDA Version: 12.2     |  
|-----------------------------------------+----------------------+----------------------+  
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |  
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |  
|                                         |                      |               MIG M. |  
|=========================================+======================+======================|  
|   0  Quadro P5000                   Off | 00000000:73:00.0 Off |                  Off |  
| 26%   31C    P8               6W / 180W |     56MiB / 16384MiB |      0%      Default |  
|                                         |                      |                  N/A |  
+-----------------------------------------+----------------------+----------------------+  

+---------------------------------------------------------------------------------------+  
| Processes:                                                                            |  
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |  
|        ID   ID                                                             Usage      |  
|=======================================================================================|  
|    0   N/A  N/A      5291      G   /usr/lib/xorg/Xorg                           49MiB |  
|    0   N/A  N/A      5384      G   /usr/bin/gnome-shell                          4MiB |  
+---------------------------------------------------------------------------------------+  

I would be immensely grateful if anyone could provide guidance or share their experience deploying IMI on a local workstation. Thank you so much in advance!


@laestrada
Copy link
Collaborator

laestrada commented Dec 8, 2024

Hi @doudouwa002 ,

The IMI ubuntu docker container maintains the same paths as the AWS AMI and has the software environment preloaded. The error you are running into should resolve if you have isAWS: true in your config.yml file. The reason why is that the docker container mimics the AWS AMI (same paths and environment setup).

"""
Given the specifications of my workstation, do you think it’s reasonable to run IMI on it? Is it capable of handling the workload, or is it too limited to run IMI effectively?
"""
It should work on your workstation if the settings specified in the config (for resource allocation) are within your available resources. One caveat is that geoschem may not work on ARM chip systems (e.g., Mac M1, M2, etc.).

"""
Additionally, if I run IMI locally, will the container automatically download the required datasets (e.g., satellite data, meteorological data, boundary conditions) from AWS?
"""
These will be automatically downloaded according to your config file.

Good luck! Curious to hear if this works!

--
Lucas and the IMI team

@doudouwa002
Copy link
Author

doudouwa002 commented Dec 10, 2024

Dear @laestrada ,

I’m so happy to receive your reply—thank you so much for your insights! However, while you mentioned a potential issue with the config.yml file, I’ve also considered this possibility. My current setup uses a local config.yml file, and I’ve ensured to specify its path and environment variables within compose.yml. After multiple rounds of debugging, I suspect the problem lies with the GEOS-Chem environment configuration file instead.

Since our last discussion, I’ve made some adjustments. Below is the complete content of my compose.yml file:

---  
# IMI Docker Compose File  
services:  
  imi:  
    image: public.ecr.aws/w1q7j9l2/imi-ubuntu-docker-image:imi-2.0.1  
    volumes:  
      - /home/ustcpolar/Documents/imi_container/myEnv/gcclassic.rocky+gnu12.minimal.env:/home/ubuntu/integrated_methane_inversion/envs/Harvard-Cannon/gcclassic.rocky+gnu12.minimal.env  # mounte the GEOS-Chem environment file
      - /home/ustcpolar/Documents/imi_container/myEnv/config.yml:/home/ubuntu/integrated_methane_inversion/config.yml  
      - /home/ustcpolar/Documents/imi_container/imi_output:/home/ubuntu/imi_output_dir  
      - ~/.aws:/root/.aws  
    environment:  
      IMI_CONFIG_PATH: /home/ubuntu/integrated_methane_inversion/config.yml  
      GEOSChemEnv: /home/ubuntu/integrated_methane_inversion/envs/Harvard-Cannon/gcclassic.rocky+gnu12.minimal.env #added its path to the environment variable

Questions:

  1. In compose.yml, I mounted the GEOS-Chem environment file gcclassic.rocky+gnu12.minimal.env and added its path to the environment variable GEOSChemEnv . Do you see any issues with how this is configured or formatted?
  2. The gcclassic.rocky+gnu12.minimal.env file in my local setup is identical to the one in the Docker image because I wasn’t sure how to modify it and opted to leave it unchanged.

Regarding my local config.yml file, I set isAWS to false. The file is provided below. I’ve also added the path to GEOSChemEnv on line 34.

1  ## IMI configuration file
 2  ## Documentation @ https://imi.readthedocs.io/en/latest/getting-started/imi-config-file.html
 3  
 4  ## General
 5  RunName: "Test_Permian_1week"
 6  isAWS: false
 7  UseSlurm: false #I've set the UseSlurm to false
 8  SafeMode: true
 9  S3Upload: false
10  ...
11  ## Custom state vector
12  StateVectorFile: "/home/ubuntu/integrated_methane_inversion/resources/statevectors/StateVector.nc"        
13  ShapeFile: "/home/ubuntu/integrated_methane_inversion/resources/shapefiles/PermianBasin_Extent_201712.shp"
14  ...
15  ##------------------------------------------------------------------
16  ## Settings for running on local cluster
17  ##------------------------------------------------------------------
18
19  ## Path for IMI runs and output
20  OutputPath: "/home/ubuntu/imi_output_dir"
21
22  ## Path to GEOS-Chem input data
23  DataPath: "/home/ubuntu/ExtData"
24
25  ## Path to TROPOMI Data
26  # DataPathTROPOMI: "/n/holylfs05/LABS/jacob_lab/imi/ch4/tropomi"
27
28  ## Conda environment file
29  CondaEnv: imi_env
30  CondaFile: /home/ubuntu/.bashrc
31
32  ## GEOS-Chem environment file (with fortran compiler, netcdf libraries, etc.)
33  ##   NOTE: Copy your own file in the envs/ directory within the IMI
34  GEOSChemEnv: "/home/ubuntu/integrated_methane_inversion/envs/Harvard-Cannon/gcclassic.rocky+gnu12.minimal.env"
35
36  ## Download initial restart file from AWS S3?
37  ##  NOTE: Must have AWS CLI enabled #
38  RestartDownload: true     #should be like this?
39
40  ## Path to initial GEOS-Chem restart file + prefix
41  ##   ("YYYYMMDD_0000z.nc4" will be appended)
42  RestartFilePrefix: "/home/ubuntu/ExtData/BoundaryConditions/v2024-06/GEOSChem.BoundaryConditions."
43
44  ## Path to GEOS-Chem boundary condition files (for regional simulations)
45  ## BCversion will be appended to the end of this path. ${BCpath}/${BCversion}
46  BCpath: "/home/ubuntu/ExtData/BoundaryConditions"
47  BCversion: "v2024-06"
48
49  ## Options to download missing GEOS-Chem input data from AWS S3
50  HemcoPriorEmisDryRun: false   #should be like this?
51  SpinupDryrun: false
52  ProductionDryRun: false
53  PosteriorDryRun: false
54  BCdryrun: false

Further Questions:
Given that I’m running on a local workstation,about the config.yml above:

  1. Line 26: Do I need to provide the path for TROPOMI data, even though I don’t have it locally?
  2. Line 38: Should I set RestartDownload to true?
  3. Lines 50–54: Should all these options be set to false?
  4. Could you kindly review the config.yml for any additional issues?

Come back to the GEOS-Chem Environment Variable Error:

After setting in compose.yml and in config.yml file, when I docker compose up, the error message is as follows:

$ docker logs e42101868d90
 * Starting MUNGE munged
   ...done.
 * Starting slurm central management daemon slurmctld
   ...done.
 * Starting slurm compute node daemon slurmd
   ...done.
Overriding config variables in /home/ubuntu/integrated_methane_inversion/config.yml with environment variables.
No config variables overridden.

=== PARSING CONFIG FILE (run_imi.sh) ===

Activating conda environment: imi_env

Loading GEOS-Chem environment: /home/ubuntu/integrated_methane_inversion/envs/Harvard-Cannon/gcclassic.rocky+gnu12.minimal.env
/home/ubuntu/integrated_methane_inversion/envs/Harvard-Cannon/gcclassic.rocky+gnu12.minimal.env: line 20: module: command not found 

The error suggests that the module command is not recognized.Could it be an issue with the environment file? Could you please advise me on which parts I should modify with the geos-chem environment file based on my actual setup (local workstation, Ubuntu system), or provide me with a more suitable template? I would greatly appreciate your advice on how to debug or resolve this issue effectively.

Below is the content of gcclassic.rocky+gnu12.minimal.env:

###############################################################################  
# gcclassic.rocky+gnu12.minimal.env  
# Environment file for GCClassic + Rocky Linux + GNU Compiler Collection 12.2.0  
...  
module purge  
...  
module load gcc/12.2.0-fasrc01  
module load openmpi/4.1.4-fasrc01  
module load netcdf-c/4.9.2-fasrc01  
...  

I also noticed the following code in the integrated_methane_inversion/src/utilities/sanitize_input_yaml.py file within the container:

...
# variables only required by local cluster
config_required_local_cluster = [
    "DataPathTROPOMI",
    "GEOSChemEnv",
]
...

It seems that, besides the issue with GEOSChemEnv, I also need to consider the DataPathTROPOMI. I aim to automatically download the required satellite and meteorological data from AWS. I've already included the AWS account and credentials in the compose.yml file. Beyond this, are there any other changes or arrangements I need to make?

I have attached the three relevant complete files, config.yml ,gcclassic.rocky+gnu12.minimal.env and sanitize_input_yaml.py in myEnv.zip.

Looking forward to your reply!

Thank you very much for your patience and guidance!

Best regards,
Chen Xiao Dong
myEnv.zip

@laestrada
Copy link
Collaborator

laestrada commented Dec 10, 2024

Hi @doudouwa002,

As I said in the previous message, in your config.yml, you need to set isAWS: true NOT false. I believe this will fix your error.

The cannon environment will not help you because that file is specific to the Harvard cluster. The GC environment is already pre loaded when the docker container starts.

It seems that, besides the issue with GEOSChemEnv, I also need to consider the DataPathTROPOMI. I aim to automatically download the required satellite and meteorological data from AWS. I've already included the AWS account and credentials in the compose.yml file. Beyond this, are there any other changes or arrangements I need to make?

The input data will be automatically downloaded, you actually do not need to input AWS credentials anymore, as we were able to get the data hosted by AWS publicly.

@doudouwa002
Copy link
Author

Oh my goodness, I can’t believe I misread it! You explained it so clearly and thoroughly before! I’m so sorry for my lack of professionalism and carelessness—it must have wasted your time! I guess subconsciously, I assumed that a locally run setup couldn’t have anything to do with the cloud, and I didn’t fully understand what you meant by ‘has the software environment preloaded.’ Also, since I’m just starting out, I’ve been feeling quite anxious, which made me overcomplicate and overthink everything. My apologies again—I understand it now and will try it right away! @laestrada

@laestrada
Copy link
Collaborator

No worries, let us know if you run into more issues -- I am curious to see how it works on a local workstation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants