- Docker or podman
- Docker-compose:
pip install docker-compose
- Taskfile
- Git
- Python >= 3.8
- Node >= v16 (NOTE: node v17 does not seem to work with websockets)
NOTE podman users (only for mac and linux):
By default all dev scripts use docker
binary. Podman users must install podman-docker
package or run the following command:
sudo ln -s $(which podman) $(dirname $(which podman)/docker)
First you need to clone the ansible-events-ui
repository:
git clone https://github.com/benthomasson/ansible-events-ui.git
cd ansible-events-ui
Create virtual environment and install project
python -m venv .venv
source .venv/bin/activate
pip install -e .
Install Ansible and benthomasson.eda
collection:
pip install ansible
ansible-galaxy collection install benthomasson.eda
You need to start up a PostgreSQL database sever.
task dev:services:start
Then run database migrations:
task dev:run:migrations
task dev:api:start
Build UI files:
task dev:ui:start
Visit this url: http://localhost:9000/api/docs#/auth/register_register_api_auth_register_post
Click "Try it out" on /api/auth/register
Change email and password
Click execute
Visit this url:
For API docs
- http://localhost:8080/api/docs
- http://localhost:8080/api/redocs
- http://localhost:8080/api/openapi.json
Also you can check the openapi specification.
You have set up the development environment.
Note: Instead of running the above tasks individually, you can run the following.
task dev:start:all
Requires docker-compose installed. See the documentation for instructions. (latest stable version is recommended)
cd tools/docker
docker-compose up --build
NOTE Podman users:
Docker compose by default will try to expose the docker socket through a mount volume. Podman users must create a .env
file in tools/docker
dir defining the variable DOCKER_SOCKET_MOUNT
with the correct path of the socket. For example:
# .env file
DOCKER_SOCKET_MOUNT=/run/user/1000/podman/podman.sock
Requires:
- installation of Kubernetes CLI (kubectl)
- installation of kustomize
- installation of minikube
- installation of docker
- bash, version 5.1.* or above
Start minikube if it is not already running
minikube start
Check that minikube instance is up
minikube status
Build image and deployment files. (If you do not provide a version as shown below docker tag will default to "latest")
task minikube:build -- 001
Deploy application to minikube. (If you do not provide a version as shown below docker tag will default to "latest")
task minikube:deploy -- 001
Forward the webserver port to local host. (If you do not provide a local port it will default to "8080")
task minikube:fp:ui -- 8080
In a second terminal run the following cmd to create a dev
user with a password of none2tuff
.
(You will use this to log into the console.)
scripts/createuser.sh [email protected] none2tuff
Visit this url for EDA app
Note: Instead of running the above build, deploy, and minikube-fp-ui tasks individually. It is possible to do the following, being mindful that it will use default values.
task minikube:all
You have set up the development environment.
If not started, start the PostgreSQL service, which is required for running integration tests.
docker-compose -f tools/docker/docker-compose.yml up postgres
Run all tests:
task test
Or call pytest
directly:
python -m pytest