Intro to Computing at FACET-II
Ivan Rajkovic
Facility for Advanced Accelerator Experimental Tests
Overview
FACET-II Summer Intern Program - Intro to computing at FACET-II
SLAC Network
firewall
Bastion hosts:
jump.slac.stanford.edu
rocky9.slac.stanford.edu
nx4.slac.stanford.edu
fastx.slac.stanford.edu
s3dflogin.slac.stanford.edu
s3dfnx.slac.stanford.edu
SLAC Network
Controls network
- Local, no internet access
mcclogin
facet-srv01
facet-srv20
iana, s3dfdtn….
FACET-II Summer Intern Program - Intro to computing at FACET-II
Remote connection
FACET-II Summer Intern Program - Intro to computing at FACET-II
FACET-II controls network access
Your home directory is synced between s3df and mcclogin, but not facet-srv01�
More info: https://confluence.slac.stanford.edu/display/FACET/FACET-II+Home
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git (and CVS) at FACET-II
FACET-II Summer Intern Program - Intro to computing at FACET-II
Why do we need a version control system?
FACET-II Summer Intern Program - Intro to computing at FACET-II
GIT vs CVS
Repository
Local
copy 1
Local
copy 2
Local
copy N
Centralized version system (CVS, SVN,...)
Repository
Local repo
Local repo
Local repo
Local
copy 1
Local
copy 2
Local
copy N
Distributed version system (Git, Mercurial,...)
Developer 1
Developer 1
Developer 2
Developer 2
Developer N
Developer N
Central Server
Remote Server
FACET-II Summer Intern Program - Intro to computing at FACET-II
Version control systems for software
9
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git or CVS???
10
PyDM panel
EDM panel
facethome
Matlab GUI panel
FACET-II Summer Intern Program - Intro to computing at FACET-II
What does this look like for FACET?
11
‘master’ matlabTNG repository
‘production’ copy
Your local copy
Edit files -
Commit(s) -
Merge/check for conflicts -
Edit files (if needed) -
Push changes to master -
FACET-II Summer Intern Program - Intro to computing at FACET-II
What does this look like for FACET – with many users
12
‘master’ matlabTNG repository
‘production’ copy
My code changes
Someone else’s work
Your local copy
FACET-II Summer Intern Program - Intro to computing at FACET-II
Where to find more information
13
FACET-II Summer Intern Program - Intro to computing at FACET-II
Get access to both Git and CVS
(and facet CVS repositories for edm, if needed)
14
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git Step 1: Clone a repository to your git_work directory
15
•This puts a local repo and local copy onto your facet-srv01 account
•This is now your own “private” version that you will work on
•But – it is a clone at this specific time, new changes are not automatically updated
• Later on use: git pull to update your local copy to include the latest code updates.
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git Step 2: Typical workflow for editing a file
16
1) Edit the file
2) Commit the changes with a USEFUL comment
3) Uploads your local copy commits to the remote server. i.e. publishes your changes
nano
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git Step 3: Update the production repo
17
1) Get to the right directory
2) Pull the latest version of the master repository
FACET-II Summer Intern Program - Intro to computing at FACET-II
Git workflow summary
FACET-II Summer Intern Program - Intro to computing at FACET-II
CVS Step 1 - Workflow is similar with CVS
19
1) Checks out the current version of the file to you.
Do not forget this step!
2) The –A argument checks if your repo is current
FACET-II Summer Intern Program - Intro to computing at FACET-II
CVS Step 2 – Edit your file and commit
20
1) Commit the changes with a USEFUL comment
1) Adds the file to the repo
2) Commits the new file
FACET-II Summer Intern Program - Intro to computing at FACET-II
CVS Step 3 – Update the production version
For EDM files, change to the production directory and update:
21
Moves the new version to the production machine
FACET-II Summer Intern Program - Intro to computing at FACET-II
CVS workflow summary
-- or --
Repository
Local copy
update
commit
FACET-II Summer Intern Program - Intro to computing at FACET-II
Extra steps
FACET-II Summer Intern Program - Intro to computing at FACET-II
Final thoughts
24
FACET-II Summer Intern Program - Intro to computing at FACET-II