Skip to content

Commit

Permalink
change logo for email templ, dev config
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalesi committed Jan 20, 2025
1 parent adfbff5 commit e2ea065
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 31 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ Make sure you have the following dependencies installed:
- [jq](https://jqlang.github.io/jq/download/)
- Stripe API key (`STRIPE_SECRET_KEY` test key and `STRIPE_DEVICE_NAME=dev` in `./.env.local`)

# Configuration

**Running in Macos (M4):**
For users running the virtual-lab-api on macOS with the M4 chip, the docker-compose configuration requires specific updates to ensure compatibility with the architecture and resource management. Please apply the following changes:

**Delta service:**
Add the following property to ensure the service runs using the correct architecture:
```
platform: linux/amd64
```

**Elasticsearch service:**
Include the following environment variables to configure memory usage and disable SVE (Scalable Vector Extensions):
```
ES_JAVA_OPTS: "-Xms512m -Xmx512m -XX:UseSVE=0"
CLI_JAVA_OPTS: "-XX:UseSVE=0"
```

# Development

1. Install the dependencies
Expand All @@ -33,6 +51,7 @@ Make sure you have the following dependencies installed:
This should start the server on port 8000 (http://127.0.0.1:8000)
The docs will be available at http://127.0.0.1:8000/docs#/


# Retrieving tokens for test users

The token for user `test` (only user right now that can create virtual labs) is already copied to your clipboard when you run `make init`.
Expand Down Expand Up @@ -109,7 +128,6 @@ For further details on working with Setup Intents and managing payment methods,
stripe setup_intents confirm seti_1PFtBwFjhkSGAqrAUHCvTAAA \
--payment-method=pm_card_visa
```

# IDE Setup

## VS Code
Expand Down
26 changes: 5 additions & 21 deletions env-prep/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ services:

delta:
container_name: delta
platform: linux/amd64
depends_on:
keycloak:
condition: service_started
Expand All @@ -105,8 +106,6 @@ services:
condition: service_started
postgres:
condition: service_started
storage-service:
condition: service_started
localstack:
condition: service_started
environment:
Expand All @@ -117,9 +116,7 @@ services:
entrypoint:
- '/bin/bash'
- '-c'
- |
ln -sf /opt/docker/plugins/disabled/project-deletion.jar /opt/docker/plugins/project-deletion.jar &&
/opt/docker/bin/delta-app -Xmx4G
- '/opt/docker/bin/delta-app'
ports:
- 8080:8080
volumes:
Expand All @@ -134,7 +131,8 @@ services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.1
environment:
ES_JAVA_OPTS: "-Xmx2G"
ES_JAVA_OPTS: "-Xms512m -Xmx512m -XX:UseSVE=0"
CLI_JAVA_OPTS: "-XX:UseSVE=0"
discovery.type: "single-node"
bootstrap.memory_lock: "true"
xpack.security.enabled: "true"
Expand Down Expand Up @@ -196,21 +194,7 @@ services:
extra_hosts:
- "host.docker.internal:host-gateway"
- "172.17.0.1:host-gateway"

storage-service:
container_name: "nexus-storage-service"
image: bluebrain/nexus-storage:latest
environment:
STORAGE_CONFIG_FILE: "/config/storage.conf"
KAMON_ENABLED: "false"
entrypoint: [ "./bin/storage",
"-Dkamon.modules.prometheus-reporter.enabled=false",
"-Dkamon.modules.jaeger.enabled=false" ]
ports:
- 8090:8090
volumes:
- ./config:/config


localstack:
image: localstack/localstack:3.5
environment:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ asyncpg = "^0.29.0"
asyncpg-stubs = "^0.29.1"
stripe = "^9.6.0"
sentry-sdk = {extras = ["fastapi"], version = "^2.14.0"}
requests = "^2.32.3"


[tool.poetry.group.dev.dependencies]
Expand Down
Binary file modified virtual_labs/infrastructure/email/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
/* -------------------------------------
HEADER, FOOTER, MAIN
------------------------------------- */
.logo {
width: 147px;
height: 50px;
}

.main {
color: #003A8C;
Expand Down Expand Up @@ -123,13 +127,14 @@
.invited-to {
display: inline-block;
padding: 0 15px;
padding-top: 4px;
background-color: #003a8c;
color: white;
border-radius: 36px;
line-height: 22px;
text-align: center;
vertical-align: middle;
padding-top: 4px;
padding-bottom: 4px;
}

.light {
Expand Down Expand Up @@ -343,9 +348,9 @@
<td>&nbsp;</td>
<td class="container">
<div class="content">
<img src="cid:logo" alt="Open Blue Brain Platform" />
<img class="logo" src="cid:logo" alt="Open Blue Brain Platform" />
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader">Invitation to Blue Brain Open Platform {{origin}}</span>
<span class="preheader">Invitation to Open Brain Platform {{origin}}</span>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="main">

<!-- START MAIN CONTENT AREA -->
Expand Down Expand Up @@ -394,12 +399,11 @@
<tr>
<td class="wrapper align-left description" style="color: #ffffff;">
<h3>
What is Open Blue Brain Platform?
What is Open Brain Platform?
</h3>
<p class="light">OBBP is the next generation platform that connects explorative features
with a
powerful set of models building tools that lead to simulation experiments. From ion
channels to the whole brain, OBBP empower scientific in their daily tasks. Explore,
<p class="light">OBP is the next generation platform that connects explorative features
with a powerful set of models building tools that lead to simulation experiments.
From ion channels to the whole brain, OBP empower scientific in their daily tasks. Explore,
collect and use real biological data to digitally simulate neurons.</p>
<table role="presentation" border="0" cellpadding="0" cellspacing="0"
class="btn btn-secondary" style="color: #ffffff;">
Expand Down
2 changes: 1 addition & 1 deletion virtual_labs/infrastructure/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Settings(BaseSettings):

INVITE_JWT_SECRET: str = "TEST_JWT_SECRET"
INVITE_EXPIRES_IN_DAYS: int = 7
INVITE_LINK_BASE: str = "http://localhost:3000/"
INVITE_LINK_BASE: str = "http://localhost:3000"

STRIPE_SECRET_KEY: str = ""
STRIPE_DEVICE_NAME: str = ""
Expand Down
1 change: 1 addition & 0 deletions virtual_labs/usecases/invites/invitation_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ async def invitation_handler(
"status": "already_accepted",
},
)

if vlab_invite.user_email != auth[0].email:
raise UserMismatch(
"Invite email not match the authenticated user email"
Expand Down

0 comments on commit e2ea065

Please sign in to comment.