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

Fix documentation #259

Merged
merged 1 commit into from
Oct 12, 2024
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
23 changes: 17 additions & 6 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ There are several ways to build and run AMT.

AMT uses 2 build systems within its project. One for the frontend (NPM) and one for the backend (Poetry).

Poetry is a Python package and dependency manager. Before you can install Poetry you first need to install Python. Please follow [these](https://github.com/pyenv/pyenv?amt=readme-ov-file#installation) instructions.
Poetry is a Python package and dependency manager. Before you can install Poetry you first need to install Python.
Please follow [these](https://github.com/pyenv/pyenv?amt=readme-ov-file#installation) instructions to install Python
3.12.

Once you have Python available you can install Poetry. See [here](https://python-poetry.org/docs/#installation).

NPM (Node package manager) is a node package and dependency manager. Before you can use NPM we recommend you install NVM (node version manager). Please follow[these](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) instructions.
NPM (Node package manager) is a node package and dependency manager. Before you can use NPM we recommend you install
NVM (node version manager). Please
follow[these](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) instructions.

once NVM is install you can execute the following commands to install node and NPM

Expand Down Expand Up @@ -50,7 +54,9 @@ poetry run python -m uvicorn amt.server:app --log-level warning

## Building AMT with Containers

Containers allows to package software, make it portable, and isolated. Before you can run a container you first need a container runtime. There are several available, but al lot of users use [docker desktop](https://www.docker.com/products/docker-desktop/).
Containers allows to package software, make it portable, and isolated. Before you can run a container you first need a
container runtime. There are several available, but al lot of users
use [docker desktop](https://www.docker.com/products/docker-desktop/).

After installing a Docker runtime like Docker Desktop you can start building the applications with this command:

Expand All @@ -74,7 +80,8 @@ export AUTO_CREATE_SCHEMA=true

## Database

We support most SQL database types. You can use the variable `APP_DATABASE_SCHEME` to change the database. The default scheme is sqlite.
We support most SQL database types. You can use the variable `APP_DATABASE_SCHEME` to change the database. The default
scheme is sqlite.

If you change the `models` at amt/models of the application you can generate a new migration file

Expand All @@ -92,7 +99,9 @@ alembic upgrade head

## Language support

We use babel for translations and a custom yaml for dynamic translations. Babel does not support Frysian, so we added a custom piece of code to support this. To generate, update or compile the language files, use the script in ./script/translate.
We use babel for translations and a custom yaml for dynamic translations. Babel does not support Frysian, so we added a
custom piece of code to support this. To generate, update or compile the language files, use the script in
./script/translate.

### Known quirks

Expand All @@ -119,7 +128,9 @@ For testing, linting and other feature we use several tools. You can look up the

## Devcontainers

[VSCode](https://code.visualstudio.com/) has great support for devcontainers. If your editor has support for devcontainers you can also use them to start the devcontainer. Devcontaines offer great standardized environments for development.
[VSCode](https://code.visualstudio.com/) has great support for devcontainers. If your editor has support for
devcontainers you can also use them to start the devcontainer. Devcontaines offer great standardized environments for
development.

## Updating dependencies

Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
![GitHub License](https://img.shields.io/github/license/minbzk/amt)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=MinBZK_amt&metric=ncloc)](https://sonarcloud.io/summary/new_code?id=MinBZK_amt)

AMT is a modern tool to apply technical and non-technical tests for an AI model.
AMT is a modern tool for bookkeeping of algorithmic systems (AI or not) and to apply technical and non-technical tests
for algorithms.

Note: The main branch may be in an unstable or even broken state during development. Please use releases instead of the main branch.
A demo of the tool is deployed here: https://amt.prd.apps.digilab.network.

The tool is built by the [AI Validation Team](https://minbzk.github.io/ai-validation/).

## How to contribute

Expand All @@ -33,13 +36,13 @@ spaces. The second parameter is the location of the system card.
An example command:

```shell
./check-state urn:nl:aivt:ir:td:1.0 urn:nl:aivt:ir:iama:1.0 example/system_test_card.yaml
./check-state urn:nl:aivt:ir:td:1.0,urn:nl:aivt:ir:iama:1.0 example/system_test_card.yaml
```

### For developers

When running the GitHub actions locally you can use [act](https://github.com/nektos/act), to do this run change the
matrix in the `ci.yml` of the `test-local` job to have only python version 3.11. Then run the following command:
matrix in the `ci.yml` of the `test-local` job to have only python version 3.12. Then run the following command:

```shell
act -W '.github/workflows/ci.yml' -s GITHUB_TOKEN="$(gh auth token)" --artifact-server-path tmp/artifacts -e act_event.json
Expand Down
16 changes: 11 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ This document describes how you can use AMT without building it.

## Using AMT

To use AMT without building we recommend the pre-build docker images on [github](https://github.com/MinBZK/amt/pkgs/container/amt).
To use AMT without building we recommend the pre-build docker images
on [github](https://github.com/MinBZK/amt/pkgs/container/amt).

You can deploy AMT to kubernetes or run the container locally using docker compose.

- Example [kubernetes](https://github.com/MinBZK/ai-validation-infra/tree/main/apps/amt)
- Example [docker compose](./compose.yml)

To run amt locally create a compose.yml file and install [docker desktop](https://www.docker.com/products/docker-desktop/). Once you have install docker you can run the following command in the directory where you created the compose.yml
To run amt locally create a compose.yml file and
install [docker desktop](https://www.docker.com/products/docker-desktop/). Once you have install docker you can run the
following command in the directory where you created the compose.yml

```bash
docker compose up
Expand Down Expand Up @@ -69,7 +72,8 @@ it is possible to run AMT with the following databases:
- MariaDB
- Oracle

We recommend using postgresql for production grade deployments because that one is tested in our CI/CD. By default AMT will use SQLite which will create a local database within the AMT container.
We recommend using postgresql for production grade deployments because that one is tested in our CI/CD. By default AMT
will use SQLite which will create a local database within the AMT container.

See [Options](#Option) on how to configure a database

Expand All @@ -79,13 +83,15 @@ AMT supports detailed logging that gives you control on what to log.

See [Options](#Option) for the logging options.

Currently AMT uses the logging config as defined [here](https://github.com/MinBZK/amt/blob/main/amt/core/log.py). youi can append or change the config byu setting the LOGGING_CONFIG environmental variable.
Currently AMT uses the logging config as defined [here](https://github.com/MinBZK/amt/blob/main/amt/core/log.py). youi
can append or change the config byu setting the LOGGING_CONFIG environmental variable.

```shell
export LOGGING_CONFIG='{"loggers": { "amt": { "propagate": "True" }},"formatters": { "generic": { "fmt": "{name}: {message}"}}}'
```

For more info on how to set logging see the python [logging.config](https://docs.python.org/3/library/logging.config.html) library
For more info on how to set logging see the
python [logging.config](https://docs.python.org/3/library/logging.config.html) library

## Options

Expand Down
Loading