Skip to content

echo-chamber0/shell-test

Repository files navigation

Data Commons Cloud Run Deployment

Fully automated deployment tool for Data Commons service on Google Cloud Run. No terminal commands needed - just answer a few questions and everything is deployed automatically.

Quick Start

One-Click Deployment

Open in Cloud Shell

What opens:

  • Editor: Friendly welcome guide (tells you what to do)
  • Right Panel: Full tutorial (optional, for more details)
  • Terminal: Automated deployment tool (already running)

Your experience:

  1. Read the welcome guide in the editor
  2. Answer 4 questions in the terminal
  3. Wait 2-3 minutes for automatic deployment
  4. Get your service URL

What happens:

  1. Answer 4 questions in the terminal
  2. Everything deploys automatically (2-3 minutes)
  3. Get your service URL

Total time: 3-5 minutes. No commands to type.

What Gets Deployed

  • Cloud Run Service: Serverless container platform with auto-scaling (0-10 instances)
  • Container Image: nginx web server (configurable)
  • IAM Configuration: Public or authenticated access
  • HTTPS Endpoint: Automatic SSL certificate provisioning

Estimated Cost: $0.00/month (within GCP free tier for low traffic)

How It Works

The deployment tool automatically:

  1. Validates your configuration inputs
  2. Generates Terraform configuration files
  3. Initializes Terraform
  4. Plans infrastructure changes
  5. Deploys to Google Cloud Run
  6. Retrieves and displays the service URL

No manual terminal commands required.

Prerequisites

  • Google Cloud Project with billing enabled
  • Required IAM permissions: roles/run.admin, roles/iam.serviceAccountUser

Authentication: The tool automatically detects if you're not authenticated and prompts you to log in. In Cloud Shell, authentication is automatic.

Manual Deployment (Optional)

If you prefer to run manually:

git clone https://github.com/echo-chamber0/shell-test.git
cd shell-test
pip install -r requirements.txt
python setup.py

The tool handles everything - no need to run terraform commands manually.

Configuration Options

During setup, you'll be asked for:

  • Project ID: GCP project identifier (validated format)
  • Service Name: Cloud Run service name (DNS-compliant)
  • Region: Deployment region (select from list)
  • Access Control: Public or authenticated access

Architecture

Internet (HTTPS)
     |
Cloud Run Service
     |
Container (nginx)
     |
Auto-scaling: 0-10 instances
CPU: 1 vCPU (1000m)
Memory: 256 MiB

Customization

To customize the deployment, edit terraform/variables.tf:

Container Image

variable "container_image" {
  default = "your-registry/your-image:tag"
}

Resource Limits

variable "cpu_limit" {
  default = "2000m"  # 2 vCPU
}

variable "memory_limit" {
  default = "512Mi"  # 512 MiB
}

Resource Cleanup

To remove all deployed resources, run:

./cleanup.sh

The cleanup script automatically handles authentication and removes all resources. Manual cleanup is also possible but requires authentication setup:

export GOOGLE_OAUTH_ACCESS_TOKEN=$(gcloud auth print-access-token)
cd terraform && terraform destroy

Troubleshooting

Authentication Issues

The tool automatically checks authentication at startup:

  • Not authenticated: Prompts you to run gcloud auth login
  • OAuth errors: Automatically refreshes authentication tokens

In Cloud Shell, authentication is handled automatically.

Permission Errors

Ensure your account has required permissions:

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="user:YOUR_EMAIL@example.com" \
  --role="roles/run.admin"

API Not Enabled

Enable required APIs:

gcloud services enable run.googleapis.com

Features

  • Zero Command Line: No terminal commands needed
  • Input Validation: All inputs validated before deployment
  • Progress Indicators: Visual feedback during deployment
  • Error Handling: Clear error messages with solutions
  • Automatic Retry: Authentication refresh on OAuth errors
  • Professional UI: 3D ASCII art banner and formatted output

Support

For issues or questions:

License

MIT License - see LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published