Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify local development setup for contributors #11

Open
iamliamc opened this issue Sep 25, 2020 · 5 comments
Open

Clarify local development setup for contributors #11

iamliamc opened this issue Sep 25, 2020 · 5 comments

Comments

@iamliamc
Copy link

So after commenting out the brickserver container from the docker-compose.yml and running: sh docker/start.sh I get:

Error: '/gunicorn_conf.py' doesn't exist

So I docker exec -it brickserver /bin/bash and found the file in the container because I couldn't divine where it came from via the image...

My goal is to run the three other containers (mongo/postgres/virtuoso) as images and develop locally on the application layer. I'll post other issues I run into here hopefully to streamline the solutions eventual PR.

@iamliamc
Copy link
Author

Ran into:

ImportError: cannot import name 'run_until_first_complete' from 'starlette.concurrency' (/Users/liam/anaconda2/envs/brick/lib/python3.8/site-packages/starlette/concurrency.py)

Had to upgrade starlette per this source:
pip install starlette==0.13.4

@iamliamc
Copy link
Author

So it's now getting clear that I don't actually want to develop running the app with the docker/run.sh as that supports concurrency on the server but rather uvicorn brick_server:app

@iamliamc
Copy link
Author

iamliamc commented Sep 25, 2020

Seems like there will be numerous changes to the configs/config.json file to get this working as well... hopefully I'm not missing something (i.e. a different paradigm to setup a local development environment)

The only other option that comes to mind is to run a build locally every set of changes, and make the brickserver section of the docker-compose.yaml reference a local image...

@iamliamc
Copy link
Author

iamliamc commented Sep 25, 2020

So I think i've got it going the main thing required is to update the docker-compose.yaml to expose ports locally and then update the necessary config in configs/config.json to map the right port forwarding to each database.

I chose arbitrary port forward numbers as I already have some of these databases installed locally

docker-compose.yaml

version: '3'
services:
  brickserver-postgres:
    container_name: brickserver-postgres
    image: "jbkoh/brickserver-postgresql:latest"
    environment: # Below secrets should be matched with the information in `configs.json` too.
      - POSTGRES_USER=bricker
      - POSTGRES_PASSWORD=brick-demo
      - POSTGRES_DB=brick
    ports:
      - "1110:5432"
  brickserver-virtuoso:
    container_name: brickserver-virtuoso
    image: "tenforce/virtuoso:virtuoso7.2.5"
    environment:
      - SPARQL_UPDATE=true
    ports:
      - "1111:8890"
  brickserver-mongo:
    container_name: brickserver-mongo
    image: "mongo:4.2.3-bionic"
    ports:
      - "1112:27017"

configs/config.json

{
    "timeseries": {
        "dbtype": "timescaledb",
        "dbname": "brick",
        "user": "bricker",
        "password": "brick-demo",
        "host": "localhost",
        "port": 1110
    },
    "lockmanager": {
        "dbname": "brick",
        "user": "bricker",
        "password": "brick-demo",
        "host": "localhost",
        "port": 1110,
        "dbtype": "postgresql"
    },
    "brick": {
        "dbtype": "virtuoso",
        "host": "http://localhost:1111/sparql",
        "brick_version": "1.0.3",
        "base_ns": "bldg",
        "base_graph": "brick-base-graph"
    },
    "users": {
        "dbtype": "mongo",
        "host": "mongodb://localhost:1112",
        "dbname": "brickserver"
    },
    "hostname": "localhost:8000",
    "auth": {
        "jwt": {
            "privkey_path": "./configs/jwtRS256.key",
            "pubkey_path": "./configs/jwtRS256.key.pub"
        },
        "oauth_connections": {}
    },
    "frontend": {}
}

@skewty
Copy link

skewty commented Nov 3, 2021

Relates to Issue #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants