Coding Interface
It is recommended to save all of your files and folders within my-private-bucket, since everything that is outside of this folder is permanently deleted after 30 days from the last access into Coding.
As you can see from the image below, the ESA MAAP coding environment is based on Jupyter. This means that most of the functionalities related to writing codes, interacting with the terminal or managing the file browser, are exactly the same. So, the main aspects will be covered in this guide, but in case you need a deeper understanding you can refer to the Jupyter documentation.
Once the workspace has loaded, you can see the Jupyter interface, characterized by the Launcher, the file browser and the sidebar.
Launcher
The Launcher is the central part of the screen, where the available kernels are displayed.
To display a new Launcher page, you can click on the blue icon “+” on the top left, or on the "+" icon near the Launcher tab.
From the Launcher, you can:
-
Create a new notebook file
-
Write commands by console
-
Open the terminal
-
Create new text and markdown files
-
Create new Python files (.py) or, depending on the chosen environment, create also R (.r) and Julia (.jl) files
Notebook files
To create and edit a new notebook file (.ipynb), you can click on one of the kernel icons under the “Notebook” section, depending on which programming language you want to use. The new notebook file will appear on the left side, initially named Untitled.ipynb. The new file will be saved under the current working directory.
Console
By clicking on one of the icons under the “Console” section, you can write commands in the language you selected. Commands can be written in multiple rows (by clicking Enter) and they can be sent by clicking Shift + Enter.
Terminal
The terminal is accessible by clicking on the “Terminal” icon, under the “Other” section, and it will be opened referring to the current working directory. You can assess your current directory by typing the pwd command.
The user’s Jupyter home directory (~) is mounted to /home/jovyan.
Files in here persist across sessions and exist across the workspaces. Other folders can be created in /home/jovyan (e.g. /home/jovyan/new_folder) to organize files in a persistent way. See the related documentation to learn more.
Sidebar
On the left part of the screen, you can find the Jupyter Sidebar, which includes:
-
File Browser
-
Running Terminals & Kernels
-
Git Repo Interface
Note: the Git repo interface is not available in the “Minimal Environment”.
Clone a Repository with GitHub
Here is an example repository you can use for this guide: https://github.com/MAAP-Project/dps-unit-test
-
Copy the Github clone link from https://github.com/MAAP-Project/dps-unit-test, going in “Code” and then clicking the icon as showed below:
-
Open the built-in Jupyter Github to the left of the file browser. Choose “Clone a Repository” and paste in the .git link you copied from the Github repository. You can also access this menu through the Git tab at the top of the Jupyter window.
-
Now you should see a new folder with the cloned Git repository. By clicking on the Github icon while browsing to the new folder, you can see additional information about the repo.
Upload Files and Folders
On the left side of the screen you can see the uploaded folders and/or files. Other folders can be created by clicking on the icon highlighted by the red arrow. To upload one or more files, click on the icon highlighted by the blue arrow.
Storage in the PAL Coding Component
Fast cloud storage
Your Jupyter home director (~) is mounted to /home/jovyan. Files in here persist across sessions:
- Use this for code-related items, smaller data storage (such as Jupyter Notebooks, Python/ R/ Markdown files, etc.)
- Git is more likely to behave predictably here compared to other storage
- This is also the place to make persistent conda environments (see Environments.md), but make sure to not make a conda env inside a git-tracked folder, or if you do add it to the .gitignore. If git is tracking an env, it could cause your workspace to crash.
- Uses local (to Jupyter) file system; generally faster and more reliable for “normal” file operations, but expensive.
Large file storage: my-private-bucket & my-storage
Your Jupyter workspace has a set of pre-mounted S3 folders that can be used to share and partition your data and files:
- my_storage (read only): This folder contains your uploaded data from the Visualisation & Analytics (Perception) component on the PAL and your processing outputs that you generated in the Processing Component (Intellect) of the PAL. Note that these folders are read-only.
- my-private-bucket: This is an an S3 bucket with persistent storage, but accessible only to you. It is useful for large data storage. It is not intended that you do all of your work in this directory. It will be slower than the home folder to copy and move files, which is why it is not ideal for storing smaller files that need to be read or written quickly (e.g. Jupyter Notebooks).
Sharing files: my-public-bucket and shared-buckets
Tip: Find your username (an alphanumeric ID) by typing: ls -l ~/my-public-bucket
- my-public-bucket: Each user has a publicly hosted folder called
my-public-bucket. Files in this folder are automatically uploaded to the storage and are accessible from any workspace a user signs into. The intention of this mounted folder is that you can use this to share data with others. Other users can access what you put in your public bucket by going to shared-buckets and the folder marked with your user ID: It is the same as ~/shared-buckets/my_username/ — anything you put in here will be accessible to other users via ~/shared-buckets/ as a read-only file. - shared-buckets (read only): To find shared files from another user, look in ~/shared-buckets/their_username.
Tip: Git can behave slowly and strangely over s3 bucket-based storage (i.e., my-private-bucket and my-public-bucket). It is recommended to set up your git-tracked repos on the root (somewhere inside of ~).
Additional Resources
-
JupyterLab Documentation: For a deeper dive into using JupyterLab functionalities, refer to the official documentation: https://readthedocs.org/projects/jupyterlab/
- MAAP Github: Here you find the offical MAAP Github repository: https://github.com/MAAP-Project











No comments to display
No comments to display