Skip to content

Commit

Permalink
fix: updated cm public api key and other minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Dec 11, 2024
1 parent cb6411e commit a63931c
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 207 deletions.
3 changes: 1 addition & 2 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
$schedule->command('coconut:entries-process')->everyMinute()->withoutOverlapping();
$schedule->command('coconut:entries-import')->everyMinute()->withoutOverlapping();
$schedule->command('app:dash-widgets-refresh')->everyFifteenMinutes()->withoutOverlapping();
$schedule->command('coconut:cache')->everyFifteenMinutes()->withoutOverlapping();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ public function infolist(Infolist $infolist): Infolist
])
->schema([
ImageEntry::make('parent_canonical_smiles')->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->parent_canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->parent_canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
->ring(5)
->defaultImageUrl(url('/images/placeholder.png')),
ImageEntry::make('canonical_smiles')->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
->ring(5)
->defaultImageUrl(url('/images/placeholder.png')),
ImageEntry::make('standardized_canonical_smiles')->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->standardized_canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->standardized_canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand All @@ -133,7 +133,7 @@ public function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
2 changes: 1 addition & 1 deletion app/Filament/Dashboard/Resources/MoleculeResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function table(Table $table): Table
ImageColumn::make('structure')->square()
->label('Structure')
->state(function ($record) {
return env('CM_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
return env('CM_PUBLIC_API', 'https://api.cheminf.studio/latest/').'depict/2D?smiles='.urlencode($record->canonical_smiles).'&height=300&width=300&CIP=true&toolkit=cdk';
})
->width(200)
->height(200)
Expand Down
4 changes: 2 additions & 2 deletions app/Livewire/MoleculeDepict2d.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class MoleculeDepict2d extends Component
#[Computed]
public function source()
{
return env('CM_API').'depict/2D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width;
return env('CM_PUBLIC_API').'depict/2D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width;
}

#[Computed]
public function preview()
{
return env('CM_API').'depict/2D?smiles='.urlencode($this->smiles);
return env('CM_PUBLIC_API').'depict/2D?smiles='.urlencode($this->smiles);
}

public function downloadMolFile($toolkit)
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/MoleculeDepict3d.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MoleculeDepict3d extends Component
#[Computed]
public function source()
{
return env('CM_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit';
return env('CM_PUBLIC_API').'depict/3D?smiles='.urlencode($this->smiles).'&height='.$this->height.'&width='.$this->width.'&CIP='.$this->CIP.'&toolkit=rdkit';
}

public function downloadSDFFile()
Expand Down
97 changes: 97 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
services:
app:
build:
context: .
dockerfile: ./FrankenPHP.Dockerfile
image: coconut-8.3/app
container_name: coconut_app
env_file:
- .env
networks:
- coconut
ports:
- '${APP_PORT:-8000}:8000'
depends_on:
- pgsql
- redis
- cm
worker:
build:
context: .
dockerfile: ./FrankenPHP.Dockerfile
image: coconut-8.3/app
container_name: coconut_worker
env_file:
- .env
networks:
- coconut
depends_on:
- app
- pgsql
- redis
- cm
environment:
WITH_SCHEDULER: true
WITH_HORIZON: true
pgsql:
image: "informaticsmatters/rdkit-cartridge-debian:latest"
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'coconut-pgsql:/var/lib/postgresql/data'
- './docker/pgsql/create-testing-database.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql'
networks:
- coconut
healthcheck:
test:
- CMD
- pg_isready
- '-q'
- '-d'
- '${DB_DATABASE}'
- '-U'
- '${DB_USERNAME}'
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'coconut-redis:/data'
networks:
- coconut
healthcheck:
test:
- CMD
- redis-cli
- ping
retries: 3
timeout: 5s
cm:
image: "nfdi4chem/cheminformatics-microservice:latest-lite"
environment:
HOMEPAGE_URL: "https://docs.api.naturalproducts.net"
ports:
- '${APP_PORT:-8001}:80'
healthcheck:
test: ["CMD", "curl", "-f", "http://cm:80/latest/chem/health"]
interval: 1m30s
timeout: 10s
retries: 20
start_period: 60s
networks:
- coconut
networks:
coconut:
driver: bridge
volumes:
coconut-pgsql:
driver: local
coconut-redis:
driver: local
10 changes: 2 additions & 8 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
services:
app:
build:
context: .
dockerfile: ./FrankenPHP.Dockerfile
image: coconut-8.3/app
image: nfdi4chem/coconut:latest
container_name: coconut_app
env_file:
- .env
Expand All @@ -16,10 +13,7 @@ services:
- redis
- cm
worker:
build:
context: .
dockerfile: ./FrankenPHP.Dockerfile
image: coconut-8.3/app
image: nfdi4chem/coconut:latest
container_name: coconut_worker
env_file:
- .env
Expand Down
70 changes: 0 additions & 70 deletions resources/ops/docker/app/app.dockerfile

This file was deleted.

66 changes: 0 additions & 66 deletions resources/ops/docker/nginx/nginx.dockerfile

This file was deleted.

Loading

0 comments on commit a63931c

Please sign in to comment.