Skip to content

Commit

Permalink
First Draft GitHub Codespaces setup, preparation Summer Term 2024 (#355)
Browse files Browse the repository at this point in the history
* set Ubuntu to 22.04 LTS for WSL2

* Update windows_wsl2.rst

* make ubuntu 22.04 the explicit version for CoLRev

* Update setup.rst

* make installation of ubuntu 22.04 mandatory

* Create github_codespaces.rst

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update setup.rst; link to codespaces setup

* Update github_codespaces.rst; add "additional repo" steps

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update github_codespaces.rst

* Update github_codespaces.rst

* Update github_codespaces.rst

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dengdenglele and pre-commit-ci[bot] authored Feb 27, 2024
1 parent f52b105 commit 53b2ca1
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/dev_docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ The last sections of the setup explain how to setup CoLRev on Windows using the
setup/part_3_colrev
setup/windows_wsl2
setup/macos_vm
setup/github_codespaces
82 changes: 82 additions & 0 deletions docs/source/dev_docs/setup/github_codespaces.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Install GitHub Codespaces
-------------------------
A short introduction video into GitHub Codespaces: `How to use GitHub Codespaces for Coding and Data Science <https://www.youtube.com/watch?v=kvJf8s18Vr4>`__

Prerequisites for web-based usage:

- GitHub Account
- Firefox or Chromium-based Browser

Setup `Codespaces here <https://github.com/features/codespaces>`__:

- Click: Get started for free
- Click: New codespace
- Click: Select a repository
- Enter: colrev
- Select: ColRev-Environment/colrev
- Leave the rest on default settings (Branch: main; Region: Europe West; Machine type 2-core)
- Uncheck "Auto-delete codespace" in "..." menu
- Let "GitHub Codespaces configuration" do some initial setup (happens automatically)

While on "@username ➜ /workspaces/colrev (main) $" run the following commands to setup the CoLRev development environment:

::

pip install -e .[dev,docs]
# if the command above terminates with a warning append "--break-system-packages" and rerun the command:
# pip install -e .[dev,docs] --break-system-packages
pre-commit run --all

[Optional, recommended] For local usage also required:

- Install Visual Studio Code available for Windows, Linux and macOS (`download <https://code.visualstudio.com/download>`__)
- `Short intro <https://www.youtube.com/watch?v=u9ZQpKGTog4>`__ to "Git Graph" extension for VSCode (only for local installation of VSCode, web-based view does not work/stays blank)

[Optional, recommended] Update your git credentials:

::

git config --global user.name "Lisa Smith"
git config --global user.email "lisa.smith@stud.uni-bamberg.de"
git config --global credential.helper store

[Optional] Add additional repos to current workspace and Git Graph:

::

# In local VSCode setup click on "File" (top left menu)-> "Add Folder To Workspace..." -> enter absolute path to git repository
# The newly added repo will be visible in Git Graph "Repo" drop-down menu
# If the workspace settings is not saved, newly added repositories will not persist in Git Graph

[Optional] Navigation in the terminal, open and edit text files:

::

# navigate with
ls
cd
# open any text files directly in VSCode
code mytextfile.txt
# or in the terminal window with nano or vim
nano mytextfile2.txt
vim mytextfile3.txt

[Optional, diagnostics] Check if everything is setup correctly:

::

# check if $PATH variable is correctly setup
echo $PATH | grep :/home/codespace/.local/bin:
# print effective user name
whoami
# print system information (kernel and distro version)
uname -a
# check docker functionality with docker-image "hello-world"
docker run hello-world
# print the git user name, user email and credential helper
git config user.name
git config user.email
git config credential.helper

[Optional] Create a SSH key pair and register the public key at Github
(`steps <https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent>`__).

0 comments on commit 53b2ca1

Please sign in to comment.