|
| 1 | +(using_gitpod)= |
| 2 | +# Using Gitpod |
| 3 | + |
| 4 | +## About Gitpod |
| 5 | +[Gitpod](https://www.gitpod.io/) is a browser-based development environment. |
| 6 | + |
| 7 | +These are some benefits to using Gitpod: |
| 8 | + |
| 9 | +- Bypass local computer configuration and technical issues |
| 10 | +- Save time by using a pre-configured virtual environment for contributing to open source |
| 11 | +- Save space on your local computer |
| 12 | + |
| 13 | +## Using Gitpod to Contribute to PyMC |
| 14 | + |
| 15 | +These instructions are for contributing specifically to the [pymc-devs/pymc](https://github.com/pymc-devs/pymc) repo. |
| 16 | + |
| 17 | +### Gitpod Workflow |
| 18 | + |
| 19 | +1. Fork the pymc repo: [https://github.com/pymc-devs/pymc](https://github.com/pymc-devs/pymc) |
| 20 | + |
| 21 | +2. Create a Gitpod account. You can login and authorize access via your GitHub account: [https://gitpod.io/](https://gitpod.io/) |
| 22 | + |
| 23 | + :::{note} |
| 24 | + Gitpod will show up as an authorized application in your GitHub account here: [https://github.com/settings/applications](https://github.com/settings/applications) |
| 25 | + ::: |
| 26 | + |
| 27 | +3. Grant GitHub / Gitpod integration permissions. |
| 28 | + |
| 29 | + a) Go to: [https://gitpod.io/user/integrations](https://gitpod.io/user/integrations) |
| 30 | + |
| 31 | + b) Select GitHub and then "Edit Permissions" |
| 32 | + |
| 33 | + c) Select these permission: `user:email`, `public_repo`, `repo`, `workflow` |
| 34 | + |
| 35 | + :::{figure-md} Gitpod integration |
| 36 | + |
| 37 | +  |
| 38 | + |
| 39 | + Gitpod [integration options](https://gitpod.io/user/integrations) |
| 40 | + ::: |
| 41 | + |
| 42 | +4. Within Gitpod, create a ["New Workspace"](https://gitpod.io/workspaces). Here you will want to select the forked pymc repo. If you do not see it, you can paste your forked repo path into the "Context URL" box. For example: `https://github.com/yourusername/pymc`. Then select "New Workspace". |
| 43 | + |
| 44 | + :::{figure-md} Gitpod workspace |
| 45 | + |
| 46 | +  |
| 47 | + |
| 48 | + Gitpod [workspace](https://gitpod.io/workspaces) |
| 49 | + ::: |
| 50 | + |
| 51 | + :::{note} |
| 52 | + Gitpod will pull a container and set up the workspace. It will take a few minutes for the container to build. |
| 53 | + ::: |
| 54 | + |
| 55 | +5. Once Gitpod is up and running, the interface is similar to a Visual Studio Code (VSC) interface, which will appear in your browser. You will observe installation notices in the terminal window. This can take 5-10 minutes. Once that is complete, the terminal will indicate you are on the "(base)" environment on Gitpod with your forked repo. |
| 56 | + |
| 57 | + Here is an example: |
| 58 | + |
| 59 | + ```console |
| 60 | + (base) gitpod@reshamas-pymc-0ygu5rf74md:/workspace/pymc$ |
| 61 | + ``` |
| 62 | + |
| 63 | + :::{note} |
| 64 | + This working environment has been set up with [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) which is a small, pure-C++ executable with enough functionalities to bootstrap fully functional conda-environments. |
| 65 | + ::: |
| 66 | + |
| 67 | +6. Check that your git remotes are correct with `git remote -v` at the terminal. |
| 68 | + |
| 69 | + Example: |
| 70 | + |
| 71 | + ```console |
| 72 | + (base) gitpod@reshamas-pymc-0ygu5rf74md:/workspace/pymc$ git remote -v |
| 73 | + origin https://github.com/reshamas/pymc.git (fetch) |
| 74 | + origin https://github.com/reshamas/pymc.git (push) |
| 75 | + upstream https://github.com/pymc-devs/pymc.git (fetch) |
| 76 | + upstream https://github.com/pymc-devs/pymc.git (push) |
| 77 | + (base) gitpod@reshamas-pymc-0ygu5rf74md:/workspace/pymc$ |
| 78 | + ``` |
| 79 | + |
| 80 | +7. Check which version of python and pymc are being used at the terminal. |
| 81 | + |
| 82 | + Check the version of pymc: `pip list | grep pymc` |
| 83 | + |
| 84 | + Example: |
| 85 | + |
| 86 | + ```console |
| 87 | + (base) gitpod@reshamas-pymc-vpfb4pvr90z:/workspace/pymc$ pip list | grep pymc |
| 88 | + pymc 5.1.0 /workspace/pymc |
| 89 | + pymc-sphinx-theme 0.1 |
| 90 | + ``` |
| 91 | + |
| 92 | + Check the version of python: `python3 --version` |
| 93 | + |
| 94 | + Example: |
| 95 | + |
| 96 | + ```console |
| 97 | + (base) gitpod@reshamas-pymc-vpfb4pvr90z:/workspace/pymc$ python3 --version |
| 98 | + Python 3.11.0 |
| 99 | + ``` |
| 100 | + |
| 101 | +### Reminder: Git Workflow |
| 102 | + |
| 103 | +:::{attention} |
| 104 | +At the terminal, before beginning work, remember to create a feature branch: |
| 105 | + |
| 106 | +```console |
| 107 | +git checkout -b feature-branch |
| 108 | +``` |
| 109 | + |
| 110 | +After working on a file, follow the Git workflow: |
| 111 | + |
| 112 | +- `git add file_name` |
| 113 | +- `git commit -m 'message'` |
| 114 | +- `git push origin feature-branch` |
| 115 | +::: |
| 116 | + |
| 117 | +### Gitpod Notes |
| 118 | + |
| 119 | +#### Billing |
| 120 | +The Gitpod free plan currently allows 500 free credits per month, which is 50 hours of standard workspace usage. Usage information can be found in the [Gitpod billing section](https://gitpod.io/user/billing). |
| 121 | + |
| 122 | +:::{caution} |
| 123 | +Be sure to check out the Gitpod policies on [Workspace Deletion](https://www.gitpod.io/docs/configure/workspaces/workspace-lifecycle#workspace-deletion) and learn more about: |
| 124 | + |
| 125 | +- "Starting" & "Stopping" workspaces |
| 126 | +- "Workplace Inactivity": By default, workspaces stop following 30 minutes without user input (e.g. keystrokes or terminal input commands). You can increase the workspace timeout up to a maximum of 24 hours. |
| 127 | +- Workspaces are deleted after 14 days. Pinned workspaces are never deleted automatically. |
| 128 | +- You can pin a workspace from your workspace list in the Gitpod dashboard. |
| 129 | +::: |
0 commit comments