Skip to content

Commit

Permalink
Merge pull request #66 from brain-bican/fix_windows
Browse files Browse the repository at this point in the history
Windows runner script added
  • Loading branch information
hkir-dev authored Feb 15, 2024
2 parents 8125b56 + 28b9527 commit 0efafba
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 15 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ADD dendR/nomenclature_builder.R $WORKSPACE/dendR
ADD dendR/install_packages.R $WORKSPACE/dendR
ADD dendR/required_scripts.R $WORKSPACE/dendR
ADD scripts/run.sh $WORKSPACE/scripts
ADD scripts/run.bat $WORKSPACE/scripts
ADD scripts/import.py $WORKSPACE/scripts
ADD scripts/configurations.py $WORKSPACE/scripts

Expand Down
28 changes: 21 additions & 7 deletions docs/Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ docker rmi $(docker images 'ghcr.io/brain-bican/taxonomy-development-tools:lates
docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest
```


# Install requirements
# Install Requirements

## Docker

Expand All @@ -34,16 +33,20 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

## Git

1. Setup your GitHub user configs
1. Make sure you have [Git installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).

2. Set up your GitHub user configs

```
git config --global user.name "your_github_user"
git config --global user.email "your_github_email"
```

2. Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).
3. Create a GitHub [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).

4. Set `GH_TOKEN` environment variable.

3. Set `GH_TOKEN` environment variable.
**_For Linux and MacOS:_**

- You can use `nano` or any other editor to edit the files.

Expand All @@ -67,16 +70,27 @@ export GH_TOKEN=my_github_personal_access_token_here`

`source ~/.bashrc` or `source ~/.zshrc`

- Test your new config:
- Test your new config open a new Terminal and run:

```
echo $GH_TOKEN
```

**_For Windows:_**
```
setx GH_TOKEN my_github_personal_access_token_here
```

- To test your new config open a new Command Prompt (Terminal) and run:
```
echo %GH_TOKEN%
```

## Build Taxonomy Development Tools (Optional)

Users are suggested to use the [Get Taxonomy Development Tools](#get-taxonomy-development-tools) step to have a TDT Docker Image. But, alternatively, you can build TDT docker image in your local. Checkout the project and run given command in the project root folder:
This step is optional and specifically aimed at users interested in utilizing the development branch of the TDT. Please note that the development branch may exhibit instability.

For those looking to use the TDT, it's recommended to follow the [Get Taxonomy Development Tools](#get-taxonomy-development-tools) section to obtain a TDT Docker Image. However, as an alternative, you have the option to build the TDT Docker image locally. To do this, clone the project repository and execute the provided command within the root directory of the project:

```
docker build --no-cache -t "ghcr.io/brain-bican/taxonomy-development-tools" .
Expand Down
15 changes: 15 additions & 0 deletions docs/Curation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest
bash ./run.sh make load_data
```

> For Windows:
> ```
> run.bat make load_data
> ```
4- Run following command to run the online data editor:
```
bash ./run.sh make serve
```

> For Windows:
> ```
> run.bat make serve
> ```
This command will print a set of logs including a log like `nanobot::serve: listening on 0.0.0.0:3000`. This means your web editor is ready, and you can start editing your data.

5- You can start browsing web taxonomy editor from: [http://localhost:3000/table](http://localhost:3000/table)
Expand All @@ -29,4 +39,9 @@ Once you complete your editing, you can run the following command to save your o
bash ./run.sh make save
```

> For Windows:
> ```
> run.bat make save
> ```
Your data will be saved into `curation_tables` folder
6 changes: 3 additions & 3 deletions docs/NewRepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ We will walk you though the steps to make a new ontology project

`docker pull ghcr.io/brain-bican/taxonomy-development-tools:latest`

**NOTE** The very first time you run this it may be slow, while docker downloads necessary images. Don't worry, subsequent runs should be much faster!
**NOTE:** The very first time you run this it may be slow, while docker downloads necessary images. Don't worry, subsequent runs should be much faster!

**NOTE** Windows users, occasionally it has been reported that files downloaded on a Windows machine get a wrong file ending, for example `seed-via-docker.bat.txt` instead of `seed-via-docker.bat`, or, as we will see later, `project.yaml.txt` instead of `project.yaml`. If you have problems, double check your files are named correctly after the download!
**NOTE:** Windows users, occasionally it has been reported that files downloaded on a Windows machine get a wrong file ending, for example `seed-via-docker.bat.txt` instead of `seed-via-docker.bat`, or, as we will see later, `project.yaml.txt` instead of `project.yaml`. If you have problems, double check your files are named correctly after the download!

## 3. Run the wrapper script

Expand All @@ -39,7 +39,7 @@ Using the predefined [CCN20230601_project_config.yaml](https://github.com/brain-
seed-via-docker.bat -C CCN20230601_project_config.yaml

This will create your starter files in
`target/human_m1`. It will also prepare an initial
`target/nhp_basal_ganglia_taxonomy`. It will also prepare an initial
release and initialize a local repository (not yet pushed to your Git host site such as GitHub or GitLab).

### Problems?
Expand Down
9 changes: 4 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Taxonomy Development Tools Guide

This guide is intended for maintainers and editors of CCN2 Taxonomies.
This guide is designed for the maintainers and editors responsible for managing CCN2 Taxonomies.

The first part of the guide is how to set up a new taxonomy
project. This requires some technical steps.
Initially, the guide provides instructions on preparing your system and initiating a new taxonomy project, which involves several technical procedures.

The second part of the guide is for curating the CCN2 taxonomies.
Subsequently, it delves into the process of curating the CCN2 taxonomies, offering detailed guidance on the necessary steps and considerations.

- [Get Your System Ready](Build.md)
- [Create a New Repo](NewRepo.md)
- [Get TDT Docker Image](Build.md)
- [Start Curating Taxonomies](Curation.md)
3 changes: 3 additions & 0 deletions scripts/run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if not exist "%homedrive%%homepath%\tdt_datasets" mkdir "%homedrive%%homepath%\tdt_datasets"

docker run -v "%cd%:/work" -v "%homedrive%%homepath%\tdt_datasets:/tdt_datasets" -w /work --rm -ti -p 3000:3000 -p 8000:8000 -e "GITHUB_AUTH_TOKEN=%GH_TOKEN%" --env "GITHUB_USER=%GITHUB_USER%" --env "GITHUB_EMAIL=%GITHUB_EMAIL%" ghcr.io/brain-bican/taxonomy-development-tools %*
5 changes: 5 additions & 0 deletions tdt/tdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ def create_run_script(outdir, tgts):
tgts.append(run_script_target)
copy(run_script_source, run_script_target)

run_script_source_win = WORKSPACE + "/scripts/run.bat"
run_script_target_win = "{}/run.bat".format(outdir)
tgts.append(run_script_target_win)
copy(run_script_source_win, run_script_target_win)


def create_output_file(outdir, project, tgts):
output_file = "{}/{}.json".format(outdir, project.id)
Expand Down

0 comments on commit 0efafba

Please sign in to comment.