Webapp¶
This service allows to visualize services and pipelines from the Core Engine. This service was built and tested with React.
It is built using React and TypeScript.
Environment variables¶
All environment variables are described in the .env
file.
The environment variables can be overwritten during the CI/CD pipeline described in the webapp.yml
GitHub workflow file.
Start the service locally with Node¶
In the webapp
directory, start the Webapp with the following commands.
A browser should open on http://localhost:3000 with the Webapp running and querying the Core Engine.
Build the application¶
In the webapp
directory, build the Webapp with the following commands.
The output of the build is in the build
directory.
Once a React application is built, the environment variables cannot be changed.
Build and run the Docker image¶
In order to build the Docker image, the application must be built beforehand. Then, the Docker image can be built with the following commands.
The Webapp is available on http://localhost:8181.
Q: Why don't we build the React application within the Docker image?
A: This setup allows us to speed up the build process of the Docker image: it does not need to download and install all dependencies every time the
package.json
file is updated. In a CI/CD set up, thenode_modules
can be cached in thebuild
stage and the output can be passed to thepublish
stage.
Start the service locally with minikube and the Docker image hosted on GitHub¶
Start the Webapp with the following commands. This will start the Webapp with the official Docker images that are hosted on GitHub.
In the webapp
directory, start the Webapp with the following commands.
Create a tunnel to access the Kubernetes cluster from the local machine. The terminal in which the tunnel is created must stay open.
Access the Webapp on http://localhost:8686.
Start the service locally with minikube and a local Docker image¶
Note: The service StatefulSet (webapp.stateful.yml
file) must be deleted and recreated every time a new Docker image is created.
Start the service with the following commands. This will start the service with the a local Docker image for the service.
In the webapp
directory, build the Docker image with the following commands.
In the webapp
directory, start the service with the following commands.
Create a tunnel to access the Kubernetes cluster from the local machine. The terminal in which the tunnel is created must stay open.
Access the Webapp on http://localhost:8686.