Coder Social home page Coder Social logo

red-hap / ansible-events-ui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mkanoor/ansible-events-ui

0.0 0.0 0.0 3.61 MB

License: Apache License 2.0

Shell 3.15% JavaScript 5.23% Python 38.16% TypeScript 52.87% CSS 0.09% HTML 0.09% Mako 0.13% Dockerfile 0.29%

ansible-events-ui's Introduction

A UI for ansible-events

Setting up a development environment

Requirements

  • 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)

1. Clone the repository

First you need to clone the ansible-events-ui repository:

git clone https://github.com/benthomasson/ansible-events-ui.git
cd ansible-events-ui

2. Virtual environment

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

3. Services

You need to start up a PostgreSQL database sever.

task dev:services:start

Then run database migrations:

task dev:run:migrations

4. Start api server

task dev:api:start

5. User interface

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

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

Run the application with docker-compose

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

Run the application on Minikube

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.

Running tests

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 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.