Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Code blocks for procedures

...

https://github.com/JCSDA-internal/r2d2-client (R2D2 V3 client: feature/cleanup1)

Related GitHub repositories:

https://github.com/JCSDA-internal/ewok (R2D2 V3: feature/r2d2v3)

...

Adding Files to EWOK_STATIC_DATA to HPC environments

Requirements:

Access to Orion since files are synced from there, although this can be worked around.

  • Access to jedi-para  or jedipara  or role-jcsda on HPCs

...

  1. Log into Orion and sudo to the role-jcsda  account. 
    Code Block
    languagebash
    themeMidnight
    ssh -Y <user_name>@orion-login.hpc.msstate.edu
    sudo -su role-jcsda
  2. Copy static files from staging location to the decided $EWOK_STATIC_DATA location. The staging location is usually given in the work ticket and is the location where the JCSDA team member has placed the data. File names can be renamed if needed. Make sure to match the permissions as the other files in $EWOK_STATIC_DATA directory (hint: chmod 644).
  3. Run the rsync from the other HPCs. There is a script located inside jedipara's ~/bin  directory the can be used to perform the rsync. Make sure the username is yours instead of the most recent team members. If you get an ssh error, you can remove the machine from known hosts and try again. An example of the script on Discover is located at /home/jedipara/bin/rsync-ewok-static-from-orion.sh. Sync to discover example:
    Code Block
    languagebash
    themeMidnight
    ssh -XY <user_name>@login.nccs.nasa.gov
    sudo -iu jedipara
    cd bin
    vi rsync-ewok-static-from-orion.sh 		# Edit to your Orion username
    bash rsync-ewok-static-from-orion.sh
  4. Check off each machine in the R2D2-data ticket as you sync.

Adding Files to EWOK_STATIC_DATA to the AWS bucket

Execute

...

the following line from Orion. Note, this can be done from your own user and aws is a part of our JEDI environment provided by spack-stack.

Code Block
languagebash
themeMidnight
/path/to/aws s3 sync --size-only --profile=jcsda-usaf-aws-us-east-2 /work2/noaa/jcsda/role-jcsda/static/ s3://r2d2.static.s3.us-east-2/

Installing the r2d2 v3 server

Note: This installation process needs to be updated and combined into one standard install.   Note: The r2d2 server does NOT require spack-stack or any spack-stack-related dependencies. 

Code Block
languagebash
themeMidnight
cd r2d2

...


python3 -m pip install -e .

...


cd server

...


python3 -m pip install -e .

Starting the r2d2 v3 server

Code Block
languagebash
themeMidnight
cd r2d2/server/app

...


pwd					
# Returns .../r2d2/server/app

...

Then

...


run_r2d2_app --port=8080 --debug

...


# You should see this output. This means that the server is running.

...


* Serving Flask app 'app.app'

...


* Debug mode: on

...


WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.

...


* Running on all addresses (0.0.0.0)

...


* Running on http://127.0.0.1:8080

...


* Running on http://192.168.10.66:8080

...


Press CTRL+C to quit

...


* Restarting with stat

...


* Debugger is active!

...

 
* Debugger PIN: 912-946-391

Installing the r2d2 v3 client

Code Block
languagebash
themeMidnight
cd r2d2-client

...


python3 -m pip install -e .

How to use the r2d2 v3 client generator

Code Block
languagebash
themeMidnight
cd r2d2/server/app

...


python3
>>> from generator import Generator

...


>>> Generator().generate(client_output_path='/Users/eric2/jedi/jedi-bundle/r2d2-client/src/r2d2_client/r2d2_client.py')

...


>>> # OR
>>> Generator(selected_item='observation').generate(client_output_path='/Users/eric2/jedi/jedi-bundle/r2d2-client/src/r2d2_client/r2d2_client.py')

Using the r2d2 v3 client

Code Block
languagebash
themeMidnight
python3
>>> from r2d2_client import R2D2Client

...


>>> R2D2Client.search_experiment(user='eric')

How to launch the Swagger Editor for editing app.yaml using a localhost Docker container

Code Block
languagebash
themeMidnight
docker pull swaggerapi/swagger-editor

...


docker run -d -p 80:8080 swaggerapi/swagger-editor

Important Reference Links

...