Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
20 changes: 10 additions & 10 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ name: "CICD Reinforcer"
on:
pull_request:
branches:
- 'main'
- 'r**'
- "main"
- "r**"
types: [labeled]
merge_group:
types: [checks_requested]
Expand Down Expand Up @@ -81,14 +81,14 @@ jobs:
# Some output that's helpful for debugging
echo "Docs changed: $CHANGED_DOCS"
echo "Src changed: $CHANGED_SRC"

# echo "DOCS_ONLY: $DOCS_ONLY"
echo "LABEL: $LABEL"
echo "IS_PULLREQUEST: $IS_PULLREQUEST"

# Run CI only (on main or if label is attached) and if it's not only docs
echo run_ci=$([[ ("$LABEL" = "true" || "$IS_PULLREQUEST" = "false" || "$MERGE_GROUP" = "true") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT"

lint-check:
name: Lint check
needs: [pre-flight]
Expand All @@ -102,7 +102,7 @@ jobs:
pip install pre-commit
pre-commit install
pre-commit run --all-files --show-diff-on-failure --color=always

sphinx-build:
name: Sphinx build
needs: [pre-flight]
Expand All @@ -115,7 +115,7 @@ jobs:
run: |
pip install uv
cd docs/
uv run --extra docs sphinx-build . _build/html
uv run --group docs sphinx-build . _build/html

build-container:
if: ${{ needs.pre-flight.outputs.run_ci == 'true' }}
Expand All @@ -140,7 +140,7 @@ jobs:
TIMEOUT: 10
SCRIPT: |
cd ${REINFORCER_REPO_DIR}/docs
uv run --extra docs sphinx-build -b doctest . _build/doctest
uv run --group docs sphinx-build -b doctest . _build/doctest
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}

Expand All @@ -154,7 +154,7 @@ jobs:
TIMEOUT: 15
SCRIPT: |
cd ${REINFORCER_REPO_DIR}
uv run --extra test bash -x ./tests/run_unit.sh
uv run --group test bash -x ./tests/run_unit.sh
FINAL_SCRIPT_EXTERNAL: |
cat <<EOF | tee -a $GITHUB_STEP_SUMMARY
# Unit test results
Expand Down Expand Up @@ -186,4 +186,4 @@ jobs:
# cd ${REINFORCER_REPO_DIR}
# uv run bash ./tests/functional/${{ matrix.test_case }}
# secrets:
# HF_TOKEN: ${{ secrets.HF_TOKEN }}
# HF_TOKEN: ${{ secrets.HF_TOKEN }}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN chmod 755 /home/ray/.cache
WORKDIR /opt/reinforcer
RUN uv venv .venv
# uv sync has a more reliable resolver than simple uv pip install which can fail
RUN uv sync --extra test --extra dev --extra docs --no-install-project
RUN uv sync --group test --group dev --group docs --no-install-project

ENV VIRTUAL_ENV=/opt/reinforcer/.venv
ENV PATH="/opt/reinforcer/.venv/bin:$PATH"
Expand Down
6 changes: 3 additions & 3 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Switch to the documentation source folder and generate HTML output.

```sh
cd docs/
uv run --extra docs sphinx-build . _build/html
uv run --group docs sphinx-build . _build/html
```

* The resulting HTML files are generated in a `_build/html` folder that is created under the project `docs/` folder.
Expand All @@ -29,7 +29,7 @@ To do so run:

```sh
cd docs/
uv run --extra docs sphinx-autobuild . _build/html --port 12345 --host 0.0.0.0
uv run --group docs sphinx-autobuild . _build/html --port 12345 --host 0.0.0.0
```

Open a web browser and go to `http://${HOST_WHERE_SPHINX_COMMAND_RUN}:12345` to view the output.
Expand All @@ -41,7 +41,7 @@ We also run tests in our python docstrings. You can run them with:

```sh
cd docs/
uv run --extra docs sphinx-build -b doctest . _build/doctest
uv run --group docs sphinx-build -b doctest . _build/doctest
```

## Writing Tests in Python Docstrings
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ packages = ["nemo_reinforcer"]
version = {attr = "nemo_reinforcer.__version__"} # any module attribute compatible with ast.literal_eval
readme = {file = "README.md", content-type = "text/markdown"}

[project.optional-dependencies]
[dependency-groups]
build = [
"torch==2.6.0",
"setuptools",
"torch==2.6.0",
"setuptools",
"packaging",
"einops"
]
Expand Down
2 changes: 1 addition & 1 deletion tests/run_unit_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ fi
# We have found that 111 does not always work and can leave the filesystem permissions in a bad state.

# Run the script inside the Docker container with GPU support
docker run -u root $INTERACTIVE_FLAG --ulimit memlock=-1 --ulimit stack=67108864 --rm --gpus '"device=0,1"' -v "$(realpath $SCRIPT_DIR/..):/workspace" -v $HF_HOME:/hf_home -e HF_TOKEN -e HF_HOME=/hf_home -e HOME=/tmp/ -w /workspace/tests "$CONTAINER" -- bash -x -c "umask 000 && uv run --extra test bash -x ./run_unit.sh $@"
docker run -u root $INTERACTIVE_FLAG --ulimit memlock=-1 --ulimit stack=67108864 --rm --gpus '"device=0,1"' -v "$(realpath $SCRIPT_DIR/..):/workspace" -v $HF_HOME:/hf_home -e HF_TOKEN -e HF_HOME=/hf_home -e HOME=/tmp/ -w /workspace/tests "$CONTAINER" -- bash -x -c "umask 000 && uv run --group test bash -x ./run_unit.sh $@"