Skip to content

equinor/acidwatch

Repository files navigation

Build and deploy to Radix Promote prod environment

AcidWatch

Welcome to the AcidWatch repository.

This repository is dedicated to the development of a common portal for tools aimed at calculating and predicting chemical reactions occurring within CO2 streams. Our goal is to democratise and open up the discussion around CO2 impurities and to provide a reliable resource for researchers, chemists, and industry professionals interested in understanding and controlling the behavior of CO2 impurities.

Links to Access AcidWatch in the Browser

AcidWatch is accessible at https://acidwatch.radix.equinor.com/, which is the official link to the latest stable version of the platform. Additionally, mainly for development purposes, we maintain three environments:

  • Development: The latest features in active development (may be unstable). Access the dev version here.
  • Testing: For testing new features (more stable than dev). Access the test version here.
  • Production: The official live platform with all tested and stable features. Access the production version here. The main URL (https://acidwatch.radix.equinor.com/) also directs to the production environment.

Please note: You might need appropriate permissions to access the environments.

How to build AcidWatch locally

Before you begin, ensure you have the following installed on your machine:

  • Node.js (version 14.x or later)
  • npm (version 6.x or later)
  • Python (version 3.10 or later)
  • Poetry (for managing Python dependencies)

Getting Started

1. Clone the Repository

Clone the repository to your local machine:

git clone [email protected]:equinor/acidwatch.git
cd acidwatch

2. Start backend

Navigate to the backend directory, create a .env file based on .env.example to configure environment variables (secrets can be found in azure portal). As of now, the app relies on you being able to connect to the Azure database and this functionality is not accessible to the users outside Equinor.

Install the dependencies using poetry, activate the Python virtual environment (we refer to Python documentation for the details) and start server:

cd backend
poetry install
cd src/acidwatch_api/
python3 __main__.py

3. Start frontend

Navigate to the frontend directory, create a .env file based on .env.example to configure environment variables. The variables begin with the prefix VITE_, but in the code they are referenced without the prefix. Then

cd ../frontend
npm install
npm run dev

4. Start models

This is optional, you can still do quite a lot frontend development without having any models running. Check the relevant models repos for guidance how to run locally:

5. Access the application

Open your browser and navigate to http://localhost:5173 to access the frontend application. The backend API will be running at http://localhost:8001. Swagger at http://localhost:8001/docs

Debugging in Visual Studio Code

If using VS Code it is recommended to run backend in a different instances of VS Code. This will avoid a lot of hazzle configuring and running correct python virtual environment etc.

Deployment

GitHub Actions Workflows are used for building, testing and deploying Acidwatch to Radix.

Tests are run on every push, and deployment to dev environment are done on merge to main branch

Deployment to test en prod environment are for now done manually in Radix console

Code spaces

If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.

1. Setup frontend

Open a terminal and write following commands to run frontend.

cd /frontend
npm run dev

2. Setup backend

Open another terminal and write following commands to enable virtual environment and then to run backend.

source venv/bin/activate .
python3 backend/src/acidwatch_api/__main__.py

3. Toggle port visibility

Kudos! Now frontend is running on port 5173, and backend is on 8001. Toggle the port for backend only to be public so its accessible by frontend.

4. Point to a different deployment environment

Now open source models can be run and tested. To point to a different instance of deployment (dev, prod or local) install-dependencies.sh can be updated.

About

Application dedicated to chemical reactions in CO2 streams

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10