UCSB-PSTAT / devcontainer-template

Development container template for generating reproducible research projects
https://computing.pstat.ucsb.edu/docs/devcontainer
1 stars 1 forks source link
devcontainer reproducible-research

Development Container Configuration Code Generator

This template repository creates a starter development container setup suitable for use in the department research computing server.

Generating Starter Code

To create your setup, follow these steps:

  1. Enter the following command to generate your project starter code:

    copier copy gh:UCSB-PSTAT/devcontainer-template <name-of-project-directory>

    where <name-of-project-directory> is the name of the directory you wish to save your project files to. The output would look similar to the following for a project called my-awesome-project:

    $> copier copy gh:UCSB-PSTAT/devcontainer-template my-awesome-project-folder
    🎤 What is the name of your project? (Must be unique and use lowercase, dashes -, underscores _ ONLY)
    my-awesome-project
    🎤 What language(s) will you use in this project?
    R and Python
    🎤 Do you want to install Visual Studio Code extensions for Jupyter notebooks using R and Python?
    Yes
    🎤 Install RStudio Server? This is optional if using VS Code and R extensions for development.
    No
    🎤 Install Quarto? Quarto is optional publishing system compatible with R and Python.
    No
    🎤 Do you want to include example files?
    Yes
    
    Copying from template version 1.4.2
        create  .
        create  README.md
        create  example.Rmd
        create  .devcontainer
        create  .devcontainer/Dockerfile
        create  .devcontainer/devcontainer.json
  2. View generated files:

    tree -a <name-of-project>

    The output would look similar to the follwing:

    $> tree -a my-awesome-project-folder
    starter-code/
    ├── .devcontainer
    │   ├── devcontainer.json
    │   └── Dockerfile
    ├── example.Rmd
    └── README.md
    
    1 directory, 4 files
  3. Use generated files:

Upload to GitHub Repository

  1. Authenticate with your GitHub account:
    gh auth login
  2. Convert generated files to a repository:
    cd /home/jovyan/work/
    git init
    git add *
    git commit -m "first commit"
    git branch -M main
  3. Upload local repository to a new GitHub repository.
    Be sure to choose, "Push an existing local repository to GitHub":
    cd /home/jovyan/work/
    gh repo create 

Download

  1. Create a zip file of starter-code contents:
    zip -r my-awesome-project.zip my-awesome-project-folder
  2. Click on Jupyter logo to open Jupyter Lab.
  3. Download the zipfile, my-awesome-project.zip
  4. Once downloaded, unzip the contents and add the .devcontainer folder to the root of your project folder.