AILIXIR Bot commited on
Commit
7922c7a
·
1 Parent(s): f0dbfed

Auto-sync: 111e815272130800a3fe964fa998478820680ada

Browse files
.github/workflows/api-tests.yml CHANGED
@@ -58,7 +58,7 @@ jobs:
58
  run: |
59
  echo "Waiting for Laravel API to be ready..."
60
  for i in {1..60}; do
61
- if docker exec ailixir-laravel curl -f http://127.0.0.1:7860 > /dev/null 2>&1; then
62
  echo "Laravel API is ready"
63
  break
64
  fi
 
58
  run: |
59
  echo "Waiting for Laravel API to be ready..."
60
  for i in {1..60}; do
61
+ if docker exec ailixir-laravel curl -f http://127.0.0.1:8000 > /dev/null 2>&1; then
62
  echo "Laravel API is ready"
63
  break
64
  fi
.github/workflows/md-simulation-health.yml CHANGED
@@ -36,7 +36,7 @@ jobs:
36
  run: |
37
  docker run -d --name ailixir-laravel \
38
  --network ailixir-md \
39
- -p 8000:7860 \
40
  --env-file docker/laravel.env \
41
  -e MD_SIMULATION_URL=http://md-api:5005 \
42
  ailixir-laravel
 
36
  run: |
37
  docker run -d --name ailixir-laravel \
38
  --network ailixir-md \
39
+ -p 8000:8000 \
40
  --env-file docker/laravel.env \
41
  -e MD_SIMULATION_URL=http://md-api:5005 \
42
  ailixir-laravel
.github/workflows/sync-hf-all.yml CHANGED
@@ -32,6 +32,18 @@ jobs:
32
  - uses: actions/checkout@v4
33
  with:
34
  fetch-depth: 0
 
 
 
 
 
 
 
 
 
 
 
 
35
  - name: Sync ailixir-api
36
  env:
37
  HF_TOKEN_AILIXIR: ${{ secrets.HF_TOKEN_AILIXIR }}
@@ -47,7 +59,6 @@ jobs:
47
  printf '%s\n' \
48
  'RUN_MODE=hf' \
49
  'APP_KEY=base64:T/MgQZht16genNJN3aZ5flCuvfe7Zfs4yFhuAFO2itU=' \
50
- 'AI_INTEGRATION_ROUTES_ENABLED=true' \
51
  'APP_URL=https://Ailixir-AI-Team-ailixir-api.hf.space' \
52
  'APP_DEBUG=true' \
53
  'ADMET_AI_URL=https://shdwRow-ailixir-admet.hf.space' \
 
32
  - uses: actions/checkout@v4
33
  with:
34
  fetch-depth: 0
35
+
36
+ - name: Install Hugging Face CLI
37
+ run: pip install -U "huggingface_hub[cli]"
38
+
39
+ - name: Set RUN_MODE=hf on Hugging Face Space
40
+ env:
41
+ HF_TOKEN: ${{ secrets.HF_TOKEN_AILIXIR }}
42
+ run: |
43
+ hf spaces secrets add Ailixir-AI-Team/ailixir-api \
44
+ -s RUN_MODE=hf \
45
+ --token "$HF_TOKEN" 2>/dev/null || true
46
+
47
  - name: Sync ailixir-api
48
  env:
49
  HF_TOKEN_AILIXIR: ${{ secrets.HF_TOKEN_AILIXIR }}
 
59
  printf '%s\n' \
60
  'RUN_MODE=hf' \
61
  'APP_KEY=base64:T/MgQZht16genNJN3aZ5flCuvfe7Zfs4yFhuAFO2itU=' \
 
62
  'APP_URL=https://Ailixir-AI-Team-ailixir-api.hf.space' \
63
  'APP_DEBUG=true' \
64
  'ADMET_AI_URL=https://shdwRow-ailixir-admet.hf.space' \
Dockerfile CHANGED
@@ -106,10 +106,10 @@ RUN chmod +x /usr/local/bin/entrypoint.sh \
106
 
107
  USER www-data
108
 
109
- EXPOSE 8000 7860
110
 
111
  HEALTHCHECK --interval=15s --timeout=5s --start-period=40s --retries=5 \
112
- CMD php -r "exit((int)(@file_get_contents('http://127.0.0.1:7860') === false));"
113
 
114
  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
115
- CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=7860"]
 
106
 
107
  USER www-data
108
 
109
+ EXPOSE 8000 7680
110
 
111
  HEALTHCHECK --interval=15s --timeout=5s --start-period=40s --retries=5 \
112
+ CMD php -r "exit((int)(@file_get_contents('http://127.0.0.1:8000') === false));"
113
 
114
  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
115
+ CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]
README.md CHANGED
@@ -4,14 +4,14 @@
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: docker
7
- app_port: 7860
8
  ---
9
 
10
  # AILIXIR Backend API
11
 
12
  Laravel backend with SQLite database for the AILIXIR drug discovery platform.
13
 
14
- - **Port:** 7860
15
  - **SDK:** Docker
16
  - **Database:** SQLite
17
 
 
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: docker
7
+ app_port: 7680
8
  ---
9
 
10
  # AILIXIR Backend API
11
 
12
  Laravel backend with SQLite database for the AILIXIR drug discovery platform.
13
 
14
+ - **Port:** 7680
15
  - **SDK:** Docker
16
  - **Database:** SQLite
17
 
README_HF.md CHANGED
@@ -4,14 +4,14 @@
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: docker
7
- app_port: 7860
8
  ---
9
 
10
  # AILIXIR Backend API
11
 
12
  Laravel backend with SQLite database for the AILIXIR drug discovery platform.
13
 
14
- - **Port:** 7860
15
  - **SDK:** Docker
16
  - **Database:** SQLite
17
 
 
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: docker
7
+ app_port: 7680
8
  ---
9
 
10
  # AILIXIR Backend API
11
 
12
  Laravel backend with SQLite database for the AILIXIR drug discovery platform.
13
 
14
+ - **Port:** 7680
15
  - **SDK:** Docker
16
  - **Database:** SQLite
17
 
app/Http/Controllers/ApiDocsController.php CHANGED
@@ -26,6 +26,12 @@ public function index()
26
  public function showDocs()
27
  {
28
  $path = base_path('API.md');
 
 
 
 
 
 
29
  $markdown = file_get_contents($path);
30
  $content = Str::markdown($markdown);
31
 
 
26
  public function showDocs()
27
  {
28
  $path = base_path('API.md');
29
+
30
+ if (!file_exists($path) || !is_readable($path)) {
31
+ $content = '<div class="alert alert-warning">API documentation file not found.</div>';
32
+ return view('api-docs', compact('content'));
33
+ }
34
+
35
  $markdown = file_get_contents($path);
36
  $content = Str::markdown($markdown);
37
 
config/sanctum.php CHANGED
@@ -17,7 +17,7 @@
17
 
18
  'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19
  '%s%s',
20
- 'localhost,localhost:3000,127.0.0.1,127.0.0.1:7860,::1',
21
  Sanctum::currentApplicationUrlWithPort(),
22
  // Sanctum::currentRequestHost(),
23
  ))),
 
17
 
18
  'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
19
  '%s%s',
20
+ 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
21
  Sanctum::currentApplicationUrlWithPort(),
22
  // Sanctum::currentRequestHost(),
23
  ))),
docker-compose.yml CHANGED
@@ -9,7 +9,7 @@ services:
9
  container_name: ailixir-laravel
10
  restart: unless-stopped
11
  ports:
12
- - "${LARAVEL_HTTP_PORT:-8080}:7860"
13
  env_file:
14
  - docker/laravel.env
15
  environment:
 
9
  container_name: ailixir-laravel
10
  restart: unless-stopped
11
  ports:
12
+ - "${LARAVEL_HTTP_PORT:-8080}:8000"
13
  env_file:
14
  - docker/laravel.env
15
  environment:
docker/entrypoint.sh CHANGED
@@ -3,18 +3,6 @@ set -e
3
 
4
  cd /var/www/html
5
 
6
- # Ensure AI integration routes and service URLs are set at runtime
7
- # (the sync workflow writes these to .env, but .env is gitignored and never reaches the container)
8
- cat >> /var/www/html/.env << 'EOF'
9
- AI_INTEGRATION_ROUTES_ENABLED=true
10
- ADMET_AI_URL=https://shdwRow-ailixir-admet.hf.space
11
- CHEMICAL_AI_URL=https://RottenShadow-ailixir-chemical-rag.hf.space
12
- DRUG_REPURPOSING_URL=https://RottenShadow-ailixir-drug-repurposing.hf.space
13
- GENERATION_SERVICE_URL=https://shdwRow-ailixir-generation.hf.space
14
- APP_URL=https://Ailixir-AI-Team-ailixir-api.hf.space
15
- APP_DEBUG=true
16
- QUEUE_CONNECTION=sync
17
- EOF
18
 
19
  php artisan config:clear --no-interaction 2>/dev/null || true
20
 
 
3
 
4
  cd /var/www/html
5
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  php artisan config:clear --no-interaction 2>/dev/null || true
8
 
docker/supervisord.conf CHANGED
@@ -4,7 +4,7 @@ logfile=/dev/null
4
  logfile_maxbytes=0
5
 
6
  [program:laravel]
7
- command=php artisan serve --host=0.0.0.0 --port=7860
8
  directory=/var/www/html
9
  autostart=true
10
  autorestart=true
 
4
  logfile_maxbytes=0
5
 
6
  [program:laravel]
7
+ command=php artisan serve --host=0.0.0.0 --port=7680
8
  directory=/var/www/html
9
  autostart=true
10
  autorestart=true