Instructions for Starting Labs via ICS ACI Portal
- Clone your Github Repository on ACI (only need to do once per assignment)
- Open notebook
- Save and commit changes as you go
Clone your github repository to begin a new assignment
- Request a “BYOE Jupyter server” session via the ACI portal (see getting started)
- While waiting for it to start, let’s get the url for the repo to be cloned.
- If you haven’t followed the link to create your repo for this week’s assignment, do that now. Following that link should trigger GitHub to create a private git repository named labN-GITHUBID (where N is the week number and GITHUBID is the GitHub username that you’re logged in as at the time you follow the link).
- Navigate to the github repository you’ll be using in your browser.
- Click Clone or download.
- If it says “Clone with https”, click “Use ssh”.
- Click the clipboard icon to copy the url onto your clipboard
- Return to your browser tab with “My Interactive Sessions”.
- Hopefully, there’s now a Connect to Jupyter Server button. Click it.
- Go to the newly opened tab, you’ll have a Jupyter Lab Server.
- If you don’t see tiles for Python, Julia and Pluto Notebooks, then click File.New_Launcher.
- Find the Terminal tile or in the menu system, File.New.Terminal.
- In the new terminal tab, clone your github repo by running
git clone REPO_URL # where REPO_URL is what you'll paste from the clipboard
- Change into the directory that was created for the repository (we’ll call REPO_DIR) and setup all the package dependencies required (as specified by the Project.toml or test/Project.toml file or embedded in Pluto notebooks).
cd REPO_DIR julia --project -e 'using Pkg; Pkg.instantiate(); '
- Optional (can do later if needed): In case the instructor makes changes to the template, it would be useful to be able to merge in those changes easily. To prepare for that, let’s set a remote upstream repository. Here I assume that your REPO_URL was https://github.com/GITHUBID/example-GITHUBID.git. Notice that we’re replacing the first GITHUB id by the organization name “PsuAstro528” and remove the “-GITHUBID” at the end.
git remote add upstream firstname.lastname@example.org:PsuAstro528/example.git
Unfortunately, Pluto notebooks can be a bit finicky. So in many cases it may make more sense to just download the replacement notebook from the starter repository and overwrite your.
If you did want to attempt to merge changes from the starting repository (e.g., for files other than Pluto notebooks), then you can run either
git pull upstream main
or if you have a newer version of git
git pull upstream main --allow-unrelated-histories
- Go back to the browser tab with your Jupyter Lab server running.
- If you do not see the tiles for Python, Julia and Pluto, then go to File.New_Launcher.
- If the lab contains Pluto notebooks (most lab exercises ending in .jl), then
- Click the Pluto tile. A new tab will open in your browser for the Pluto session.
- In the “Open from file” box, type the path to the directory containing the repo, a forward slash and the name of the first notebook (e.g., ‘lab1-yourgithubid/ex1.jl’). Tab completion is often helpful.
- If the lab contains Jupyter notebooks (files ending in .ipynb), then:
- Click the directory name of the repository that you just installed. (If you don’t see a list of files on the left, then click the Folder icon in the upper left.)
- Double click on the name of the Jupyter notebook file (e.g., ex1.ipynb)
- A new tab within the JupyerLab browser tab will open with the Jupyter notebook.
- Do your work in the notebook.
- When you’re done with a notebook, make sure it is saved (Ctrl+S) and close the tab.
Commit your changes
Ideally, you’d commit small changes as you go. At a minimum, make sure that you commit your changes each time you are wrapping up a coding session or about to take a break.