Skip to content

Commit

Permalink
Merge branch 'main' into 288_lark_functions
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-austin committed Feb 14, 2024
2 parents b8e1ea0 + eb7f545 commit a2d92d4
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 804 deletions.
2 changes: 1 addition & 1 deletion .github/ci_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ auth:
private_key_path: /home/runner/work/operationsgateway-api/id_rsa
public_key_path: /home/runner/work/operationsgateway-api/id_rsa.pub
jwt_algorithm: RS256
access_token_validity_mins: 60
access_token_validity_mins: 120
refresh_token_validity_days: 7
fedid_server_url: ldap://fed.cclrc.ac.uk:389
fedid_server_ldap_realm: FED.CCLRC.AC.UK
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ on:

jobs:
tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9"]
os: [ubuntu-20.04, ubuntu-22.04]
python-version: ["3.8", "3.9", "3.10", "3.11"]
exclude:
- os: ubuntu-22.04
python-version: "3.8"
- os: ubuntu-22.04
python-version: "3.9"
- os: ubuntu-20.04
python-version: "3.10"
- os: ubuntu-20.04
python-version: "3.11"
runs-on: ${{ matrix.os }}

name: Python ${{ matrix.python-version }} Tests
steps:
Expand All @@ -21,7 +31,9 @@ jobs:

# Install dependencies of python-ldap
- name: Install python-ldap dependencies
run: sudo apt-get install -y libsasl2-dev python${{ matrix.python-version }}-dev libldap2-dev libssl-dev
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev python${{ matrix.python-version }}-dev libldap2-dev libssl-dev
# Setup Python and environment dependencies (via cache)
- name: Setup Python
Expand All @@ -46,9 +58,6 @@ jobs:
- name: Get database name from ci_config.yml
run: echo "DATABASE_NAME=$(grep database_name .github/ci_config.yml | cut -d ':' -f 2 | tr -d '[:space:]')" >> $GITHUB_ENV

- name: Add test users to OperationsGateway database
run: mongoimport --db='${{ env.DATABASE_NAME }}' --collection='users' --file='util/users_for_mongoimport.json'

# Load Poetry virtual environment dependencies and install API dependencies
- name: Load Poetry cache
uses: actions/cache@v3
Expand Down Expand Up @@ -112,8 +121,9 @@ jobs:
repository: ral-facilities/operationsgateway-test-data
path: operationsgateway-test-data
ssh-key: ${{ secrets.SSH_PRIV_OG_TEST_DATA_ACTIONS }}

- name: Run ingestion script
run: poetry run python util/ingest_hdf.py -p operationsgateway-test-data/dev_server -U backend -P back
run: poetry run python util/ingest_hdf.py -p operationsgateway-test-data/dev_server -U backend -P back -j util/users_for_mongoimport.json

- name: Load Poetry cache for Nox tests session
uses: actions/cache@v3
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ This is an API built using [FastAPI](https://fastapi.tiangolo.com/) to work with


## Environment Setup
If not already present, you may need to install development tools for the desired Python version using the appropriate package manager for your OS. For example, for Python3.8 on Fedora or RHEL:
```bash
sudo dnf install "@Development Tools" python38 python38-pip python38-setuptools python38-devel openldap-devel git
```

[Poetry](https://python-poetry.org/) is used to manage the dependencies of this API. To install Poetry, follow [the instructions](https://python-poetry.org/docs/master/#installing-with-the-official-installer) from their documentation.

To install the project's dependencies, execute `poetry install`. The dependencies and the code in this repo are compatible with Python 3.8+.
To install the project's dependencies, execute `poetry install`. The dependencies and the code in this repo are compatible with Python >=3.8, <3.12.

## Nox Sessions
Like [DataGateway API](https://github.com/ral-facilities/datagateway-api), this repository contains a [Nox](https://nox.thea.codes) file (`noxfile.py`) which exists in the root level of this repository. There are a handful of sessions which help with repetitive tasks during development To install Nox, use the following command:
Expand Down
Loading

0 comments on commit a2d92d4

Please sign in to comment.