Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausing the automation of infura #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

This repo is aimed at housing the scripts and settings to aid in collecting other repositories and managing a kubernetes cluster(s) on GCP

## NOTICE: Paused in progress
This repository is partly complete. This repository deploys the ambient app back-end services to GCP. It includes a kubernetes manifest, instructions on deployment (below).

In progress, was:
- configuration directories (./config_stage/)
- automated setup files, geared toward GitHub action automation (run_*.sh)

Next Steps, include:
- Finishing the test scripts (run_*.sh)
- Finishing development and testing of the deployment_docker
- automating infrastructure via GitHub Actions

If you are reading these notes, in terms of onboarding, the sensible step would be to start running the setup scripts:
- run rebuild: See if the docker image is built
- run "run_infura": see if the docker container runs. It should stay online
- run "setup_infra": This step is unfinished, and should set up Google Cloud tools, secrets, and set up for GCP deployment
- run "redeploy_cluster": This should redeploy the cluster, and then shut down the container.

Although unfinished, inspecting and studying the repository should allow anyone to run the ambient application. However, at present, there is no standard method or step-by-step guide on how to complete this process, save the instructions below:


## Startup instructions

install gcloud : https://cloud.google.com/sdk/docs/install-sdk
Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions deployment_docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Use an official Debian runtime as a parent image
FROM debian:bullseye-slim

# Install prerequisites
RUN apt-get update && \
apt-get install -y curl apt-transport-https lsb-release gnupg && \
apt-get clean

# Install Google Cloud SDK
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && apt-get install -y google-cloud-sdk

# Install kubectl
RUN apt-get install -y kubectl


RUN curl -O "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-453.0.0-linux-x86_64.tar.gz"

RUN tar zxvf "google-cloud-sdk-453.0.0-linux-x86_64.tar.gz"

RUN ./google-cloud-sdk/install.sh --quiet

COPY ./config_stage/* ./

# Setup the entrypoint
#COPY entrypoint.sh /entrypoint.sh
#RUN chmod +x /entrypoint.sh

# Set the working directory
#WORKDIR /

# The entrypoint script should handle the population of secret files, gcloud and kubectl configurations.
# Ensure you create an `entrypoint.sh` script that configures everything as needed.
#ENTRYPOINT ["/entrypoint.sh"]

# Keep the container running
CMD ["tail", "-f", "/dev/null"]
23 changes: 23 additions & 0 deletions deployment_docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Populate the env secrets-.yml files using the templates
# (You need to define how you're going to replace the placeholders in your templates)
# For example:
# envsubst < secrets-template.yml > secrets-analytic-tools.yml

# Then follow these commands to get going:
# Note that you will need to provide your own configurations for `gcloud auth login` as it requires interactive user input.
gcloud components install kubectl -q
gcloud auth login --no-launch-browser
gcloud config set project YOUR_PROJECT_ID
gcloud container clusters create my-cluster --zone us-central1-a
gcloud container clusters list
gcloud container clusters get-credentials autopilot-cluster-1 --zone us-central1

# Add secrets
kubectl apply -f secrets-analytic-tools.yml
kubectl apply -f secrets-chat.yml
kubectl apply -f secrets-gcgo-candles.yml

# Execute anything else passed to the docker run command
exec "$@"
Loading