Skip to content

Rhymlore/path-portal

 
 

Repository files navigation

PATH

This is the web application for the PATh Portal

Structure

This web app is broken into two components. The Flask app that runs the api and some choice webpages, and the documentation which is built using mkdocs.

Web App

The Flask app is found in the /portal directory.

Documentation - Coming Soon

The documentation is automatically updated with GHA and is found at /documentation. If you want to update the documentation you should do so on the user-documenation repo.

Development

Running the Flask Server

This runs the web app components of the website, which means that the documentation will not work as that is served by Apache. This is the preferred way to test the web app locally.

python3 portal/app.py

Running Apache Container

To run the registration server locally, build and run the testing container image:

  1. Build the container image:

    docker build -t path-portal-testing -f testing.Dockerfile .
  2. Start the local portal:

    docker run --rm --name path-portal -it -v ${PWD}:/srv -p 8445:443 path-portal-testing
  3. Access the local portal in your browser by accessing https://localhost:8445

  4. For a login shell to the portal, run the following:

    docker exec -it path-portal /bin/bash

    Helpful log files can be found in /var/log/httpd/ and /var/log/condor/registration.log.

Note that changes to files copied into the container image (e.g. COPY lines in Dockerfile.testing) will require a rebuild of the container image.

Required Config Values

The congig.py file can be added at root and should contain the follow attributes.

SUPPORT_EMAIL="Cannon Lock <[email protected]>"

OIDC_REDIRECT_URI = "<SITE_DOMAIN>/callback"
ADMIN_EMAILS = ""

FRESHDESK_API_KEY = ""
FRESHDESK_API_URL = "https://opensciencegrid.freshdesk.com"

H_CAPTCHA_SITEKEY = "deb6e053-975d-4c72-86be-6c91fdf4babf"
H_CAPTCHA_SECRET = ""

Deployment

Deployment for the Flask App is done manually and deployment for the documentation is automatic.

Manual Tagging

Production

To toggle a new production container you should tag a new release iterating on the previous tag.

v<major>.<minor>.<bugFix>

If you make a new major release then <major> is incremented, and <minor> and <bugfix> will be 0.

If you make a new minor release then <major is kept, <minor> is incremented, and <bugfix> will be 0.

Development

For all Development images you should append .itb.<dev> with the v<major>.<minor>.<bugFix> tag being your targeted release tag.

v<major>.<minor>.<bugFix>.itb.<dev>

Automated Tagging

When documentation is updated a doc tag is incremented and prepended to the current tag.

v<major>.<minor>.<bugFix>.<doc>

If Dev:

v<major>.<minor>.<bugFix>.itb.<dev>.<doc>

Debugging on Kubernetes

Couple nice lines to expedite debugging a container on kubernetes in the dev instance

POD_NAME=$(kubectl --namespace osgdev get pods | grep path-portal | awk '{print $1}')
kubectl --namespace osgdev get pods | grep path-portal
kubectl --namespace osgdev describe pods $POD_NAME
kubectl -n osgdev --since 30m logs deploy/flux | grep path-portal |  scripts/fluxpipe 
kubectl exec --namespace osgdev -it $POD_NAME path-portal -- bash

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • SCSS 44.2%
  • CSS 39.5%
  • JavaScript 5.8%
  • HTML 5.2%
  • Python 4.9%
  • Dockerfile 0.4%