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

Add beacon network #259

Merged
merged 14 commits into from
Sep 17, 2024
8 changes: 8 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ If using Beacon, first copy the configuration file:
Then update any config values as needed at `lib/beacon/config/beacon_config.json`
and `lib/beacon/config/beacon_cohort.json`.

If using the beacon network, copy the configuration file:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capital B for beacon for consistency

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(╯°□°)╯︵ ┻━┻


```bash
./bentoctl.bash init-config beacon-network
```

and update values at `lib/beacon/config/beacon_network_config.json`.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a note about this be added to the v17 migration guide? Similar to here, basically


### Gohan configuration

Expand Down
1 change: 1 addition & 0 deletions etc/bento_deploy.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BENTO_GATEWAY_USE_TLS='true'

BENTO_BEACON_ENABLED='false' # Set to true if using Beacon!
BENTO_BEACON_UI_ENABLED='false'
BENTO_BEACON_NETWORK_ENABLED='false'
gsfk marked this conversation as resolved.
Show resolved Hide resolved
BENTO_CBIOPORTAL_ENABLED='false'
BENTO_GOHAN_ENABLED='true'
BENTO_MONITORING_ENABLED='false'
Expand Down
1 change: 1 addition & 0 deletions etc/bento_dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BENTO_GATEWAY_USE_TLS='true'

BENTO_BEACON_ENABLED='true'
BENTO_BEACON_UI_ENABLED='true'
BENTO_BEACON_NETWORK_ENABLED='false'
BENTO_CBIOPORTAL_ENABLED='false'
BENTO_GOHAN_ENABLED='true'
BENTO_MONITORING_ENABLED='false'
Expand Down
1 change: 1 addition & 0 deletions etc/default_config.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ BENTO_GATEWAY_USE_TLS='true'

BENTO_BEACON_ENABLED='true'
BENTO_BEACON_UI_ENABLED='true'
BENTO_BEACON_NETWORK_ENABLED='false'
BENTO_CBIOPORTAL_ENABLED='false'
BENTO_GOHAN_ENABLED='true'
BENTO_MONITORING_ENABLED='false'
Expand Down
10 changes: 10 additions & 0 deletions etc/templates/beacon/beacon_network_config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"beacons": [
"https://bqc19.bento.sd4h.ca/api/beacon",
"https://staging.bento.sd4h.ca/api/beacon",
"https://qa.bento.sd4h.ca/api/beacon",
"https://bentov2.local/api/beacon"
],
"network_default_timeout_seconds": 30,
"network_variants_query_timeout_seconds": 120
}
1 change: 1 addition & 0 deletions lib/public/docker-compose.public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ services:
- BENTO_PUBLIC_PORTAL_URL
- BENTO_PUBLIC_TRANSLATED
- BENTO_BEACON_UI_ENABLED
- BENTO_BEACON_NETWORK_ENABLED
- BEACON_URL=${BENTOV2_PUBLIC_URL}/api/beacon
- INTERNAL_PORT=${BENTO_PUBLIC_INTERNAL_PORT}
- BENTO_PUBLIC_URL=${BENTOV2_PUBLIC_URL}
Expand Down
6 changes: 5 additions & 1 deletion py_bentoctl/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ class InitConfig(SubCommand):
@staticmethod
def add_args(sp):
sp.add_argument(
"service", type=str, choices=["katsu", "beacon"], help="Prepares services for deployment.")
"service",
type=str,
choices=["katsu", "beacon", "beacon-network"],
help="Prepares services for deployment."
)
sp.add_argument(
"--force", "-f", action="store_true",
help="Overwrites any existing config.")
Expand Down
15 changes: 14 additions & 1 deletion py_bentoctl/other_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,14 @@ def init_config(service: str, force: bool = False):
_init_katsu_config(force)
elif service == "beacon":
_init_beacon_config(force)
elif service == "beacon-network":
_init_beacon_network_config(force)


def _init_beacon_config(force: bool):
root_path = pathlib.Path.cwd()
template_dir = (root_path / "etc" / "templates" / "beacon")
dest_dir = (root_path / "lib" / "beacon" / "config")
dest_dir = pathlib.Path(os.environ["BENTO_BEACON_CONFIG_DIR"])

config_template_path = (template_dir / "beacon_config.example.json")
config_dest_path = (dest_dir / "beacon_config.json")
Expand All @@ -648,6 +650,17 @@ def _init_beacon_config(force: bool):
_file_copy(cohort_template_path, cohort_dest_path, force)


def _init_beacon_network_config(force: bool):
root_path = pathlib.Path.cwd()
template_dir = (root_path / "etc" / "templates" / "beacon")
dest_dir = pathlib.Path(os.environ["BENTO_BEACON_CONFIG_DIR"])

network_config_template_path = (template_dir / "beacon_network_config.example.json")
network_config_dest_path = (dest_dir / "beacon_network_config.json")

_file_copy(network_config_template_path, network_config_dest_path, force)


def _init_katsu_config(force: bool):
root_path = pathlib.Path.cwd()
katsu_config_template_path = (root_path / "etc" / "katsu.config.example.json")
Expand Down
Loading