-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from stuartcampbell/update-deps
Various housekeeping updates
- Loading branch information
Showing
10 changed files
with
168 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Integration Tests for Development API | ||
|
||
on: | ||
schedule: | ||
- cron: '*/30 * * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
integration_tests: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Print hostname | ||
run: echo "The hostname is $(hostname)" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '21' | ||
|
||
- name: Download ijhttp.zip | ||
run: curl -f -L -o ijhttp.zip "https://jb.gg/ijhttp/latest" | ||
|
||
- name: Unzip ijhttp.zip | ||
run: unzip -q ijhttp.zip | ||
|
||
- name: Beamline endpoint tests | ||
run: | | ||
./ijhttp/ijhttp --env-file ./integration-tests/http-client.env.json \ | ||
--env dev \ | ||
./integration-tests/check_all_beamlines.http | ||
- name: Check API Service | ||
run: | | ||
./ijhttp/ijhttp --env-file ./integration-tests/http-client.env.json \ | ||
--env dev \ | ||
./integration-tests/check_service_health.http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,57 @@ | ||
# NSLS-II Facility API | ||
|
||
This is the repository for the NSLS-II Facility API codebase. | ||
This is the repository for the NSLS-II Facility API codebase. | ||
|
||
## Current Status | ||
|
||
[](https://github.com/NSLS2/nsls2api/actions/workflows/test-production-deployment.yml) | ||
|
||
## Developer Notes | ||
[](https://github.com/NSLS2/nsls2api/actions/workflows/test-dev-deployment.yml) | ||
|
||
## Developer Notes | ||
|
||
In order to develop locally you will need to have a local MongoDB running. | ||
This can be installed using your preferred method, a native install | ||
or [running a container](https://hub.docker.com/_/mongo) work perfectly fine. | ||
|
||
Once you have MongoDB up and running you then need to 'seed' the facility and beamline information that | ||
does not get pulled from any other source. | ||
|
||
The files for the collections can be found within the `/nsls2/software/dssi/nsls2core/nsls2core-development.tgz` | ||
|
||
1. Copy and unpack the archive into a directory (e.g. `nsls2core-development`) to your development machine | ||
|
||
2. Import facility information into the local mongodb``` | ||
```bash | ||
mongorestore --uri="mongodb://localhost:27017" --nsFrom=nsls2core-development.facilities --nsTo=nsls2core-development.facilities ./nsls2core-development/facilities.bson | ||
``` | ||
3. Import beamline information into the local mongodb | ||
```bash | ||
mongorestore --uri="mongodb://localhost:27017" --nsFrom=nsls2core-development.beamlines --nsTo=nsls2core-development.beamlines ./nsls2core-development/beamlines.bson | ||
``` | ||
|
||
You will then need to create a `.env` file that contains the configuration (an example can also be found in the same | ||
directory as the json files). | ||
|
||
1. Copy `/nsls2/software/dssi/nsls2core/.env.development` to your local machine | ||
2. Rename to `.env` and place in the `src/nsls2api` directory in your cloned repo (in the same folder as `main.py`) | ||
3. Ensure that you have the `bnlroot.crt` file (which is deployed to all BNL managed machines) in the location specified | ||
within the `.env` file. | ||
|
||
### Updating Dependencies | ||
|
||
The project uses `pip-compile` to manage the `requirements.txt` and `requirements-dev.txt`. | ||
In order to upgrade the packages you will need to install `pip-tools`. Then to upgrade simply run | ||
The project uses `uv pip compile` to manage the `requirements.txt` and `requirements-dev.txt` files. | ||
|
||
In order to upgrade the packages versions you will need to simply run | ||
|
||
``` | ||
pip-compile requirements-dev.in --upgrade | ||
pip-compile requirements.in --upgrade | ||
uv pip compile requirements-dev.in --upgrade -o requirements-dev.txt | ||
uv pip compile requirements.in --upgrade -o requirements.txt | ||
``` | ||
|
||
Then in order to actually upgrade the packages | ||
``` | ||
uv pip install -r requirements-dev.txt | ||
uv pip install -r requirements.txt | ||
``` | ||
Of course, you can drop the `uv` from these last commands if you want to wait longer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.