Skip to content

Commit 077804a

Browse files
Merge pull request #406 from CodeForPhilly/develop
Release: v1.1.0
2 parents 77cee09 + f4adf0f commit 077804a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5109
-3047
lines changed

.github/workflows/containers-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: "Containers: Publish"
22

33
on:
4-
push:
5-
tags: ["v*"]
4+
release:
5+
types: [published]
66

77
permissions:
88
packages: write
@@ -12,10 +12,10 @@ jobs:
1212
name: Build and Push
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v5
1616

1717
- name: Login to ghcr.io Docker registry
18-
uses: docker/login-action@v2
18+
uses: docker/login-action@v3
1919
with:
2020
registry: ghcr.io
2121
username: ${{ github.repository_owner }}

.github/workflows/python-app.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ "listOfMed" ]
9+
pull_request:
10+
branches: [ "listOfMed" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
- name: Install the code linting and formatting tool Ruff
27+
run: pipx install ruff
28+
- name: Lint code with Ruff
29+
run: ruff check --output-format=github --target-version=py39

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,29 @@ Tools used for development:
3636

3737
### Running Balancer for development
3838

39-
Running Balancer:
40-
- Start Docker Desktop and run `docker compose up --build`
41-
- The email and password are set in `server/api/management/commands/createsu.py`
42-
- Download a sample of papers to upload from [https://balancertestsite.com](https://balancertestsite.com/)
39+
Start the Postgres, Django REST, and React services by starting Docker Desktop and running `docker compose up --build`
4340

44-
Running pgAdmin:
41+
#### Postgres
42+
- Download a sample of papers to upload from [https://balancertestsite.com](https://balancertestsite.com/)
4543
- The email and password of `pgAdmin` are specified in `balancer-main/docker-compose.yml`
46-
- The first time you use `pgAdmin` after building the Docker containers you will need to register the server.
47-
The `Host name/address`, `Username` and `Password` are specified in `balancer-main/docker-compose.yml`
44+
- The first time you use `pgAdmin` after building the Docker containers you will need to register the server.
45+
- The `Host name/address` is the Postgres server service name in the Docker Compose file
46+
- The `Username` and `Password` are the Postgres server environment variables in the Docker Compose file
47+
- You can use the below code snippet to query the database from a Jupyter notebook:
48+
49+
```
50+
from sqlalchemy import create_engine
51+
import pandas as pd
52+
53+
engine = create_engine("postgresql+psycopg2://balancer:balancer@localhost:5433/balancer_dev")
54+
55+
query = "SELECT * FROM api_embeddings;"
56+
57+
df = pd.read_sql(query, engine)
58+
```
59+
60+
#### Django REST
61+
- The email and password are set in `server/api/management/commands/createsu.py`
4862

4963
## Local Kubernetes Deployment
5064

deploy/manifests/balancer/base/deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
app: balancer
1818
spec:
1919
containers:
20-
- image: chrissst/balancer
20+
- image: ghcr.io/codeforphilly/balancer-main/backend
2121
name: balancer
2222
envFrom:
2323
- configMapRef:

deploy/manifests/balancer/overlays/dev/kustomization.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resources:
55
- "../../base"
66

77
images:
8-
- name: chrissst/balancer
9-
newTag: v1
10-
8+
- name: ghcr.io/codeforphilly/balancer-main/backend
9+
newTag: "1.0.2"
10+
1111
namespace: balancer

docker-compose.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
services:
22
db:
3-
build:
4-
context: ./db
5-
dockerfile: Dockerfile
6-
volumes:
7-
- postgres_data:/var/lib/postgresql/data/
8-
environment:
9-
- POSTGRES_USER=balancer
10-
- POSTGRES_PASSWORD=balancer
11-
- POSTGRES_DB=balancer_dev
12-
ports:
13-
- "5433:5432"
14-
networks:
15-
app_net:
16-
ipv4_address: 192.168.0.2
17-
pgadmin:
18-
container_name: pgadmin4
19-
image: dpage/pgadmin4
3+
build:
4+
context: ./db
5+
dockerfile: Dockerfile
6+
volumes:
7+
- postgres_data:/var/lib/postgresql/data/
208
environment:
21-
PGADMIN_DEFAULT_EMAIL: [email protected]
22-
PGADMIN_DEFAULT_PASSWORD: balancer
23-
# PGADMIN_LISTEN_PORT = 80
24-
# volumes:
25-
# - ./pgadmin-data:/var/lib/pgadmin
26-
# # PGADMIN_LISTEN_PORT = 80
9+
- POSTGRES_USER=balancer
10+
- POSTGRES_PASSWORD=balancer
11+
- POSTGRES_DB=balancer_dev
2712
ports:
28-
- "5050:80"
13+
- "5433:5432"
2914
networks:
3015
app_net:
31-
ipv4_address: 192.168.0.4
16+
ipv4_address: 192.168.0.2
17+
# pgadmin:
18+
# container_name: pgadmin4
19+
# image: dpage/pgadmin4
20+
# environment:
21+
# PGADMIN_DEFAULT_EMAIL: [email protected]
22+
# PGADMIN_DEFAULT_PASSWORD: balancer
23+
# # PGADMIN_LISTEN_PORT = 80
24+
# # volumes:
25+
# # - ./pgadmin-data:/var/lib/pgadmin
26+
# # # PGADMIN_LISTEN_PORT = 80
27+
# ports:
28+
# - "5050:80"
29+
# networks:
30+
# app_net:
31+
# ipv4_address: 192.168.0.4
3232
backend:
3333
image: balancer-backend
3434
build: ./server
@@ -52,13 +52,13 @@ services:
5252
args:
5353
- IMAGE_NAME=balancer-frontend
5454
ports:
55-
- "3000:3000"
55+
- "3000:3000"
5656
environment:
57-
- CHOKIDAR_USEPOLLING=true
58-
# - VITE_API_BASE_URL=https://balancertestsite.com/
57+
- CHOKIDAR_USEPOLLING=true
58+
# - VITE_API_BASE_URL=https://balancertestsite.com/
5959
volumes:
60-
- "./frontend:/usr/src/app:delegated"
61-
- "/usr/src/app/node_modules/"
60+
- "./frontend:/usr/src/app:delegated"
61+
- "/usr/src/app/node_modules/"
6262
depends_on:
6363
- backend
6464
networks:
@@ -72,4 +72,4 @@ networks:
7272
driver: default
7373
config:
7474
- subnet: "192.168.0.0/24"
75-
gateway: 192.168.0.1
75+
gateway: 192.168.0.1

0 commit comments

Comments
 (0)