Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
update contributing and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Friedowitz committed Jan 20, 2024
1 parent 0747bea commit c6f1720
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
27 changes: 14 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,34 @@ Ruff will pick up the configuration defined in the `pyproject.toml` file automat
## Testing a development branch

`flamingo` is intended to be installed as a pip requirement in the runtime environment of a Ray job.
However, when developing the package locally it is desirable to be able to test your branch
by running jobs from it before publishing a new library version.
This is possible by submitting your Ray job with a runtime environment that points to your local,
in-development copy of the `flamingo` repo.
However, it is often desirable to test local branches on Ray before publishing a new version of the library.
This is possible submitting a Ray job with a runtime environment that points to your
development branch of the `flamingo` repo.

To do so, follow the steps:

This can be done by the following steps:
1. Export a copy of the package dependencies by running:

```poetry export --without-hashes --with finetuning,evaluation -o requirements.txt```
```
poetry export --without-hashes --with finetuning,evaluation -o requirements.txt
```
This will create a `requirements.txt` file in the repository that contains the dependencies
for the `finetuning` and `evaluation` job groups.
The following command will create a `requirements.txt` file in the repository
that contains the dependencies for the `finetuning` and `evaluation` job groups:
2. In your Ray runtime environment, specify the following:
- `py_modules`: Local path to the `flamingo` module folder (located at `src/flamingo` in the workspace).
- `pip`: Local path to the `requirements.txt` file generated above.
```<code snippet, assuming you are in `$SOURCE`>```

3. Submit your job with an entrypoint command that invokes `flamingo` directly as a module, eg:
```python -m flamingo run finetuning --config cofig.yaml```
```
python -m flamingo run finetuning --config config.yaml
```
This is necessary because `py_modules` uploads the `flamingo` module
but does not install its entrypoint in the environment path.
This is necessary because `py_modules` uploads the `flamingo` module
but does not install its entrypoint in the environment path.
An example of this workflow can be found in the `examples/dev_workflow.ipynb` notebook.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@
### Installation

This project is built using the [Poetry](https://python-poetry.org/docs/) build tool.
Follow the [installation guide](https://python-poetry.org/docs/#installation)
to install Poetry into your local Python environmennt.

Once Poetry is installed, you can install `flamingo` for development by running:
First, install Poetry in your local environment via
```
curl -sSL https://install.python-poetry.org | python3 - -y
```
or see the [installation guide](https://python-poetry.org/docs/#installation)
for more instructions.

Once Poetry is installed, you can install `flamingo` for development by running
```
poetry lock
poetry install
```

This will install an editable version of the package along with all of its dependency groups.
Poetry should recognize your active virtual environment during installation
and install the package dependencies there.
Expand Down

0 comments on commit c6f1720

Please sign in to comment.