Skip to main content

CSGShip

1. Overview

CSGShip is the Intelligent Coding Assistant backend service of the CSGHub platform. It provides core capabilities for CodeSouler (IDE plugin), including intelligent code completion, semantic search, conversational programming, AI code generation, and knowledge retrieval.

Deployed as a standalone service, CSGShip supports independent scaling of compute nodes and horizontal scaling of multiple instances. It is designed to work seamlessly with the main service (CSGHub Server).

2. Environment Requirements

Resource ItemMinimum ConfigurationRecommended Configuration
CPU / Memory4C / 8 GB8C / 16 GB
Disk Space10 GB50 GB+
ArchitectureAMD64 / ARM64Multi-arch support

Software Dependencies

ComponentVersion RequirementDescription
Kubernetes1.28+Cluster environment
Helm3.12+Chart management tool
PostgreSQL / RedisOptional (External)External managed resources are supported

3. Installation

3.1 Add Helm Repository

helm repo add csghub https://charts.opencsg.com/csghub
helm repo update

3.2 Create Namespace (Optional)

kubectl create namespace csghub

3.3 Install CSGShip

Obtain the following information from your CSGHub main service:

  1. domain: Provide a second-level domain. For example, if you provide example.com, the services will be exposed at csgship.example.com and csgship-api.example.com.

  2. externalUrl: Run the following to find the CSGHub URL:

    helm get notes csghub -n csghub | grep -A 6 'Access your CSGHub'
  3. hubAPIToken:

    kubectl get cm csghub-core -o yaml -n csghub | grep 'API_TOKEN' | awk '{print $NF}'
  4. NATS Credentials:

    # Get NATS Username and Password
    kubectl get secret -n csghub csghub-nats -o jsonpath='{.data.NATS_USERNAME}' | base64 -d
    echo -n " / "
    kubectl get secret -n csghub csghub-nats -o jsonpath='{.data.NATS_PASSWORD}' | base64 -d

    Note: Currently only service names are supported for host (same-cluster deployment).

    💡 Tip for China-based deployments:

    Add the following flags to speed up image pulls:

    • --set global.image.registry="opencsg-registry.cn-beijing.cr.aliyuncs.com"
    • --set global.imageRegistry="opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsghq"

    Execution Command:

    helm install csgship csghub/csgship \
    --namespace csghub \
    --create-namespace \
    --set global.gateway.external.domain="example.com" \
    --set externalUrl="<csghub externalUrl>" \
    --set hubAPIToken="<csghub hub_api_token>" \
    --set billing.nats.host="<csghub nats service>" \
    --set billing.nats.port=4222 \
    --set billing.nats.user="<csghub nats username>" \
    --set billing.nats.password="<csghub nats password>"

3.4 Access Paths

Service URLDescription
http://csgship.example.comCSGShip Frontend (requires --set web.oauth)
http://csgship-api.example.comCSGShip API Endpoint

4. Configuration Parameters

4.1 Global Configuration

ParameterDefaultDescription
global.editioneeEdition: ce (Community) / ee (Enterprise)
global.gateway.external.domainexample.comPrimary access domain
global.gateway.tls.enabledfalseEnable HTTPS / TLS
global.persistence.size10GiDefault PV size
global.postgresql.enabledtrueUse built-in PostgreSQL
global.redis.enabledtrueUse built-in Redis

4.2 OAuth Configuration

CSGShip supports GitLab OAuth. Set these in your values.yaml:

web:
oauth:
issuer: "https://gitlab.example.com"
clientId: "<your-client-id>"
clientSecret: "<your-client-secret>"

4.3 External Database (Production Mode)

global:
postgresql:
enabled: false
external:
host: "pg.example.com"
port: 5432
user: "csghub"
password: "StrongPassword"

5. Verification

# Check Pod status
kubectl get pods -n csghub

# Check Service addresses
kubectl get svc -n csghub

6. Upgrade & Uninstallation

6.1 Upgrade

Use the helm upgrade command with the same parameters used during installation to update to the latest version.

6.2 Uninstallation

helm uninstall csgship -n csghub

7. Troubleshooting

  • Cannot connect to main service: Check if externalUrl protocol (HTTP vs HTTPS) matches the actual CSGHub deployment.
  • Startup failure: Check logs for PostgreSQL or Redis connection errors.
  • Image pull failure: Ensure image.pullSecrets are configured if using a private registry.

8. Production Recommendations

  1. External DB/Cache: Use managed PostgreSQL and Redis for better state management.
  2. Enable TLS: Always use HTTPS for production communication.
  3. Resource Limits: Set explicit resources.requests and limits to prevent resource contention.