Skip to content

Commit

Permalink
add database init scripts && change to use correct portal port in ngi…
Browse files Browse the repository at this point in the history
…nx.conf (#644)

* modify release v0.9.0 branch tag

* add database init scripts && change to use correct portal port in nginx.conf
  • Loading branch information
wayneliu0019 authored Sep 18, 2024
1 parent fb20669 commit 0476da3
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
15 changes: 15 additions & 0 deletions deploy/all_in_one/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,21 @@ services:
volumes:
- ./.kube:/root/.kube:r

csghub_db_init:
image: opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsg_public/governmentpaas/psql:329
depends_on:
- postgres
- csghub_server_runner
environment:
PGPASSWORD: "sdfa23Sh!322"
volumes:
- ./init-scripts:/scripts
entrypoint: ["sh", "-c", "until nc -zv csghub_server 8080 ; do echo 'sleep 10s...'; sleep 10; done; echo 'begin to do db init scripts'; until pg_isready -h postgres -p 5432; do sleep 5; done; psql -h postgres -U postgres -d starhub_server -f /scripts/init.sql"]
networks:
opencsg:
ipv4_address: 192.168.100.232


csghub_server_proxy:
image: opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsg_public/csghub_server:v0.9.0
entrypoint:
Expand Down
70 changes: 70 additions & 0 deletions deploy/all_in_one/init-scripts/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--
-- PostgreSQL database dump
--


SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', 'public', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Seed Data for Name: space_resources; Type: TABLE DATA; Owner: postgres
--

INSERT INTO space_resources (name, resources, cluster_id)
VALUES
('CPU basic · 0.5 vCPU · 1 GB', '{ "cpu": { "type": "Intel", "num": "0.5" }, "memory": "1Gi" }' ,(SELECT cluster_id FROM cluster_infos LIMIT 1))
ON CONFLICT (name)
DO UPDATE SET
resources = EXCLUDED.resources,
cluster_id = EXCLUDED.cluster_id;


INSERT INTO space_resources (name, resources, cluster_id)
VALUES
('CPU basic · 2 vCPU · 4 GB', '{ "cpu": { "type": "Intel", "num": "2" }, "memory": "4Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1))
ON CONFLICT (name)
DO UPDATE SET
resources = EXCLUDED.resources,
cluster_id = EXCLUDED.cluster_id;

INSERT INTO space_resources (name, resources, cluster_id)
VALUES
('NVIDIA A10G · 4 vCPU · 16 GB', '{"gpu": { "type": "A10", "num": "1", "resource_name": "nvidia.com/gpu", "labels": { "aliyun.accelerator/nvidia_name": "NVIDIA-A10" } }, "cpu": { "type": "Intel", "num": "4" }, "memory": "16Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1))
ON CONFLICT (name)
DO UPDATE SET
resources = EXCLUDED.resources,
cluster_id = EXCLUDED.cluster_id;

INSERT INTO space_resources (name, resources, cluster_id)
VALUES
('NVIDIA A10G · 2 · 4 vCPU · 16 GB', '{"gpu": { "type": "A10", "num": "2", "resource_name": "nvidia.com/gpu", "labels": { "aliyun.accelerator/nvidia_name": "NVIDIA-A10" } }, "cpu": { "type": "Intel", "num": "4" }, "memory": "16Gi" }', (SELECT cluster_id FROM cluster_infos LIMIT 1))
ON CONFLICT (name)
DO UPDATE SET
resources = EXCLUDED.resources,
cluster_id = EXCLUDED.cluster_id;

--
-- Seed Data for Name: runtime_frameworks; Type: TABLE DATA; Owner: postgres
--

INSERT INTO runtime_frameworks (id, frame_name, frame_version, frame_image, frame_cpu_image, enabled, container_port, type) VALUES ('1', 'VLLM', '2.7', 'vllm-local:2.7', 'vllm-cpu:2.3', 1, 8000, 1);
INSERT INTO runtime_frameworks (id, frame_name, frame_version, frame_image, frame_cpu_image, enabled, container_port, type) VALUES ('3', 'TGI', '2.1', 'tgi:2.1', '', 1, 8000, 1);
INSERT INTO runtime_frameworks (id, frame_name, frame_version, frame_image, frame_cpu_image, enabled, container_port, type) VALUES ('4', 'FastChat', '1.2', ' ', '', 1, 8000, 1);
INSERT INTO runtime_frameworks (id, frame_name, frame_version, frame_image, frame_cpu_image, enabled, container_port, type) VALUES ('6', 'MindIE', '1.0', ' ', '', 1, 8000, 1);
INSERT INTO runtime_frameworks (id, frame_name, frame_version, frame_image, frame_cpu_image, enabled, container_port, type) VALUES ('2', 'LLaMA-Factory', '1.11', 'llama-factory:1.18-cuda12.1-devel-ubuntu22.04-py310-torch2.1.2', '', 1, 8000, 2);

--
-- Name: runtime_frameworks_id_seq; Type: SEQUENCE SET; Owner: postgres
--

SELECT pg_catalog.setval('runtime_frameworks_id_seq', 6, true);


0 comments on commit 0476da3

Please sign in to comment.