First you need to give sapling access to an ssh key that has access to your github account. You have two options:
First, you can add an ssh key to sapling. If you've followed the sapling-guide for legion you'll have already done this. If not, on sapling run
$ ssh-keygen -t ed25519 ... (either choose a password or enter an empty one)Once your key has been created, you can get your public key by running
$ cat ~/.ssh/id_ed25519.pubwhich you can add to your GitHub account by following the instructions here.
Alternatively, you can give sapling access to your local ssh key. To do so, you'll need to spin up an
ssh-agenton your local machine, and then configure ssh access to share thessh-agentthrough your ssh connections to sapling. More concretely, on your local machine run
eval $(ssh-agent) ssh-addand type in your ssh password if prompted. This spins up a background process for managing your ssh key. Now you need to share that agent across your ssh connection, which we can do by modifying the
~/.ssh/configfile on your local machine. You'll need to append the following lines to that file:Host sapling.stanford.edu ForwardAgent yesNote that you'll need to restart any existing ssh connections.
If you did the previous step correctly, when you run
ssh -T git@github.comon sapling you should see something to the effect of
$ ssh -T git@github.com
Hi <your-github-id>! You've successfully authenticated, but GitHub does not provide shell access.
Now we'll actually get the repostory set up. To do so, perform the following
$ curl 'https://raw.githubusercontent.com/flexflow/sapling-guide/master/repo-refactor.sh' -o repo-refactor.sh
...
$ chmod u+x ./repo-refactor.sh
...
$ ./repo-refactor.sh
...
$ source ~/.bashrc
...
$ cd "$HOME/ff"
...
$ nix develop --accept-flake-config
... (this will take a while the first time) ...
$ ffpr 622 repo-refactor
Here you should see a interactive prompt for information related to GitHub.
- Select "GitHub.com"
- Select "SSH"
- Select "Yes"
- Select "Paste an authentication token"
- Now go to https://github.com/settings/tokens and click "Generate new token" in the top right-hand corner, in the dropdown that appears select "Generate new token (classic)"
- You should see a text field called "Note". Enter the name "sapling" (this is just a note to yourself about what this key is for)
- Under "Expiration" select "90 days"
- Under "Select scopes" check the following check boxes:
repo,read:org, andadmin:public_key - Click "Generate token"
- You should now see a key beginning with
ghp_. Copy this, save it somewhere to your computer safe (if you lose it, github won't show it to you again) - Copy the key beginning with
ghp_into the prompt "Paste your authentication token:" and hit enter. - You should now see a message that says "Logged in as <your github username>", followed by a bunch of output from git as it clones the FlexFlow repository. Once that's done continue with the instructions below:
$ cd repo-refactor
...
$ nix develop --accept-flake-config
... (this will take a while the first time) ...
$ proj cmake
...
$ proj test
... (you should see a test run and pass here. if that is not the case contact @lockshaw)
TODO