You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 24 Next »

Git

Local

GitHub

SLAC has a GitHub organization called SLAC Lab. Access to it isn't granted automatically, but it's pretty easy to get! Make a GitHub account (or use one that you already have) and send your username to Brian Van Klaveren (email bvan@slac.stanford.edu or ping brianv on Slack) asking for access. Note: This step has very high potential to end up out of date if someone else ends up managing SLAC Lab, so keep that in mind.

Once you've done that, add your rhel6-64 ssh key to GitHub.

Production repositories locally live in ~/opsTools, and remotely live on GitHub.

Adding SSH Keys to GitHub

Run "set_profile [YOUR USERNAME]" then ssh into mcclogin

 

From there, ssh into rhel6-64

 

From there, cat your ssh key 

Copy the entire output (starts with ssh-rsa and ends with your email address).

Back on GitHub, go to your settings

 

And add a new SSH key

 

Title it something descriptive, paste in the output you got from cat, and save it! 

 

PyDM

Tutorial

  1. Go to https://github.com/slaclab/devPanel
  2. Click "Fork" in the upper right corner 
  3. Click the link that says [Your User Name]/devPanel (Mine says that I've already forked it, but yours should ask you where you want to fork it)
  4. Click the green "Clone or Download" button and copy the ssh path. If you see what looks like a URL, click the blue "Use SSH" link right above it
  5. Back on an OPI (or ssh'ed in), type "set_profile [Your Username]". This should take you to your personal physics directory. Make a new devPanel subdirectory
  6. In that subdirectory, run "git init"
  7. Still in that subdirectory, type "~/mgibbs/link_repo_to_github/link_repo_to_github.sh -i" and follow the prompts (if you don't feel like thinking about the AFS repo, you can use this default, but you should paste in the GitHub ssh link you got in Step 4 for your fork or you'll connect to mine! You'll get slightly different messages since I've already run this before)
  8. Type "git pull origin master" and type in your password when prompted (again, messages will be slightly different since I've done this before)
  9. Type "source use_pydm.sh" 
  10. Type "mkdir [Your Name]" and head into that directory  
  11. Type "designer &" 
  12. Sometimes you get an error saying something about backup files. Ignore it(: In the program that opens, click "Widget" and then "Create" 
  13. In the Widget box on the left, scroll all the way down and drag a drop a PyDMShellCommand somewhere in the widget that popped up in the last step
  14. Right click anywhere in the widget that isn't the tiny shell command button, hover over "layout" at the bottom, and click "lay out in a grid" 
  15. In the Object Inspector in the top right, rename that button something more descriptive by double clicking it, typing the new name, and pressing enter 
  16. Right click the button itself and click "Change text..." 
  17. Rename it something more descriptive and press enter 
  18. In the property/value table in the middle right, scroll all the way down to "commands," double click the value box (it'll be blank at first, and then it'll be a button that says "Change String List"), Click "New", type "echo hello world!", then click "OK" 
  19. Save this file as devPanel[Your Name].ui
  20. From here, open opsDevPanel.ui from the parent directory (~/[your username]/devPanel)
  21. Drag and drop a PyDMRelatedDisplayButton onto the newly opened devPanel.ui 
  22. Right click rename the button itself and its object name like before
  23. Add the path to your personal dev panel in your subdirectory and save 
  24. Back in your terminal in the devPanel directory, run "pydm opsDevPanel.ui" and you should see your creation! Feel free to play with it until it looks good to you!
  25. Run "git status" to see what's changed. It should be opsDevPanel.ui and a new folder with your name
  26. Run "git add [YOUR NEW FOLDER]" and "git add opsDevPanel.ui", then run another git status. They should both be staged for commit 
  27. run git commit -m "adding [YOUR NAME]'s dev panel"
  28. Run "git push origin master" and log in when prompted 
  29. Back on your fork on GitHub, click "New Pull Request" 
  30. Click "Create Pull Request"
  31. Add slaclab/ops as a reviewer (by clicking on the gear and then searching), and then click "Create pull request"
  32. An admin will look at it to make sure that nothing important got deleted, and if they approve it, they'll merge it into production!

 

 

 

 

 

 

 

  • No labels