Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create DEVELOPMENT.md file #1318

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Development
This file highlight the installation process of getting started with Ersilia, Ersilia Artifacts and Creating a PR.

## Getting Started
Ersilia can be run either on local computer or with the use of GitHub codespace. On your local computer, ersilia is designed to run specific environment
Ajoke23 marked this conversation as resolved.
Show resolved Hide resolved
Ajoke23 marked this conversation as resolved.
Show resolved Hide resolved
namely: **Linux and Linux-like environment** (MacOS, WSL).
Ajoke23 marked this conversation as resolved.
Show resolved Hide resolved

- ### Installation of Ersilia on local computer
To get started with Ersilia installation, there are few dependencies that needs to be installed before proceeding to installation of Ersilia. Please check the package requirement
in the [Installation Guide](https://ersilia.gitbook.io/ersilia-book/ersilia-model-hub/installation)
1. Once the required dependencies has been met, open a terminal and set up a Conda environment.

```
# create a conda environment
conda create -n ersilia python=3.10
# activate the environment
conda activate ersilia
```
2. Clone the repository and run to install the Ersilia Python package.
```
# clone from github
git clone https://github.com/ersilia-os/ersilia.git
cd ersilia
# install with pip (use -e for developer mode)
pip install -e .
Ajoke23 marked this conversation as resolved.
Show resolved Hide resolved
```
3. To test that the CLI works, explore this command
```
# output to see command options for ersilia
ersilia --help
```
4. Once ersilia is recognized in the CLI, test any model of your choice.
- First, you can check the list of available model in ersilia catalog
```
#see ersilia's model catalog
ersilia catalog
```
- Next, you can run the model
```
ersilia -v fetch eos2ta5 #fetch a model
ersilia serve eos2ta5 #serve a model
ersilia -v api run -i "CCCC" #run a model
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we can ask them to run the test suite as pytest -v

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @DhanshreeA. I intend to add the run test suites in the "Creating of Pull Request" section.


Note: The usage -v (verbose) flag is of utmost importance for developers as it provides detailed logs which helps to debug and troubleshoot issues.

- ### Using GitHub Codespace
Ajoke23 marked this conversation as resolved.
Show resolved Hide resolved
If difficulties are encountered when setting up Ersilia locally, another cloud-based development environment which suppoort linux is a great alternative.
GitHub codespaces allows you to run and develop Ersilia directly from your browser.

To use Github Codespaces:

**1. Fork and Clone the Repository**

- Navigate [Ersilia repository](https://github.com/ersilia-os/ersilia) on GitHub.
- Click on the **Fork** button in the top right corner to create a fork.
- Go to the forked repository, Click on the <> **Code**.
- Click **Create codespace**.

A pop up page "Setting up your codespace" is displayed on the screen. After a while, the codespace is created in a browser-based version using the built-in
Visual studio code interface

**2. Setting Up Codespace Environment**

- Open the terminal in codespace. To ensure you are in the root directory
`cd ersilia`
- Run this command
`pip install -e .`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't exactly need to do that I think, the environment is prepared with ersilia installed. But we should double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. ersilia is pre-installed and ready to use. To double check, i will add using ersilia --version in the documentation.
Thanks for the suggestion.


**3. Run Ersilia Model**
- Directly from the code space terminal, you can fetch, serve and run Ersilia model.
To run a model with verbose output:
`ersilia -v run eos2ta5`


## Ersilia Artifacts
After successful installation of ersilia, the system creates an EOS directory in your `$HOME` path. This directory stores
ersilia artifacts that the local computer uses when doing any operation (model execution) in Ersilia.
Folders found in the `$HOME` directory includes:

**Folders**
- dest/: stores output generated when running a model.
- isaura/: cache model prediction which stores them in the local computer
- repository/: main directory to cache models files and datasets. This prevent redundant download by storing previously fetched model
- sessions/: Tracks user session
- tmp/: stores temporary file during model execution.