Skip to content

Commit

Permalink
Env set up rework
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Hu <[email protected]>
  • Loading branch information
charleshu-8 committed Aug 23, 2024
1 parent 9514da9 commit 8945984
Show file tree
Hide file tree
Showing 3 changed files with 874 additions and 817 deletions.
72 changes: 64 additions & 8 deletions src/courses/mappers/10.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,31 @@ author: Charles Hu

In this section, we will cover:

## Environment Set Up
- How to set up an environment for OHDF mapper development via:
- [GitHub Codespaces](#github-codespaces-environment-set-up)
- [Local installation](#local-environment-set-up)

Node.js (a runtime environment for JavaScript) and Yarn (a package manager for JavaScript/TypeScript) are external utilities which are utilized extensively within this guide. The following section details their installation process.
## Overview

Linux/Mac OS:
The rest of this course will involve a mix of hands-on guided and unguided labs to teach you the basics of the technical implementation of OHDF mappers. To facilitate this, we provide two installation guides for setting up the environment necessary for these upcoming labs: A GitHub Codespaces environment set up (recommended for beginners) and a local environment set up (recommended for experienced developers or individuals interested in manually installing to their local system).

## GitHub Codespaces Environment Set Up

We provide a [GitHub Codespaces environment](https://github.com/mitre/saf-training-lab-environment) that includes a simple build script that installs the necessary repositories and packages to begin OHDF mapper development.

Follow the instructions listed in the README and you should have a verified working environment with the Heimdall and SAF CLI repositories pulled down into the `/dev_repos/` directory. Heimdall can be found under `/dev_repos/heimdall2/`, the SAF CLI can be found under `/dev_repos/saf/`, and OHDF Converters can be found under `/dev_repos/heimdall2/libs/hdf-converters/`.

## Local Environment Set Up

To set up the environment locally, we will need to pull down the GitHub repositories for Heimdall and the SAF CLI using Git and install their necessary dependencies using a package manager.

You can install Git [here](https://git-scm.com/downloads). Choose your OS and follow the installation guide as necessary.

Node.js (a runtime environment for JavaScript), NPM (a package manager for JavaScript/TypeScript), and Yarn (another package manager for JavaScript/TypeScript) are external utilities which are utilized extensively within this guide. The following section details their installation process.

### Runtime & Package Managers

#### Linux/Mac OS

1. Install [nvm](https://github.com/nvm-sh/nvm#install--update-script).

Expand Down Expand Up @@ -41,22 +61,58 @@ nvm install 18

3. Install [Yarn](https://yarnpkg.com/getting-started/install)

Windows:
#### Windows

1. Install [Node.js v18 via the installer](https://nodejs.org/en/download/).

2. Install [Yarn](https://yarnpkg.com/getting-started/install):

## Repository Set Up
### Repository Set Up

Now that we have the runtime and package managers for Javascript installed, we can pull down the necessary GitHub repositories and install their dependencies.

1. Fork/branch a development repository from the main [Heimdall2 GitHub repository](https://github.com/mitre/heimdall2).

- SAF team developers have write access to the main repository and should [create a branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/making-changes-in-a-branch/managing-branches#creating-a-branch) on the primary development repository. Non-SAF team developers should instead [create a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository) of the main repository and create a development branch there.

2. Create a draft [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request) for your development branch against the main repository branch.
2. Pull down your development branch from GitHub using the following command:

```shell
git clone {URL-TO-REPO-HERE}
```

3. Create a draft [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request) for your development branch against the main repository branch.

4. Install the necessary dependencies for Heimdall2. Under the `heimdall2` directory, enter the following command in the terminal:

```shell
yarn install --frozen-lockfile
```

5. Fork/branch a development repository from the main [SAF CLI GitHub repository](https://github.com/mitre/saf).

- SAF team developers have write access to the main repository and should [create a branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/making-changes-in-a-branch/managing-branches#creating-a-branch) on the primary development repository. Non-SAF team developers should instead [create a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo#forking-a-repository) of the main repository and create a development branch there.

6. Pull down your development branch from GitHub using the following command:

3. Install the necessary dependencies for Heimdall2. Under the `heimdall2` directory, enter the following command in the terminal:
```shell
git clone {URL-TO-REPO-HERE}
```

7. Create a draft [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request#creating-the-pull-request) for your development branch against the main repository branch.

8. Install the necessary dependencies for the SAF CLI. Under the `saf` directory, enter the following command in the terminal:

```shell
yarn install
npm install
```

You should now have a working environment with the Heimdall and SAF CLI repositories. Heimdall can be found under `/heimdall2/`, the SAF CLI can be found under `/saf/`, and OHDF Converters can be found under `/heimdall2/libs/hdf-converters/`.

## A Look Back

In this section, we covered:

- How to set up an environment for OHDF mapper development via:
- [GitHub Codespaces](#github-codespaces-environment-set-up)
- [Local installation](#local-environment-set-up)
Loading

0 comments on commit 8945984

Please sign in to comment.