Proto commits in kelda/blimp

These 53 commits are when the Protocol Buffers files have changed:

Commit:30064da
Author:Kevin Lin
Committer:Kevin Lin

blimp: Add backend This commit copies the backend code that was previously closed source into this repo.

The documentation is generated from this commit.

Commit:f4d5511
Author:Kevin Lin
Committer:Kevin Lin

auth: Remove auth0 authentication backend This makes self hosted clusters completely isolated -- they don't depend on any central services run by Kelda. Authentication is no longer done through auth0. The "token" field in protobufs are now just a way for clients to provide a unique identifier for their namespace. The only authentication is at the cluster scope via the shared cluster token.

The documentation is generated from this commit.

Commit:cbced99
Author:Kevin Lin
Committer:Kevin Lin

Fix imports The backend code lived at github.com/kelda-inc/blimp before.

Commit:7f6b636
Author:Kevin Lin

Add backend

Commit:1b33bb2
Author:Kevin Lin
Committer:Kevin Lin

auth: Auto-refresh auth tokens Users now only have to login once -- the CLI will automatically fresh new access tokens when they expire.

Commit:60276b3
Author:Christopher Cooper
Committer:Christopher Cooper

auth: Add support for cluster authorization This updates the protobuf to use a generic auth message which includes an optional cluster_auth field. The "old_token" field is preserved in the protobuf, so that the backend can still read the token from old clients that send that field instead of the new auth field. To use the new cluster_auth token, simply set the "cluster_token" field in ~/.blimp.yaml. This also generalizes some areas of the code that rely on auth being a single string, such as the registry credential for the docker registry.

Commit:ecc9895
Author:Christopher Cooper
Committer:Christopher Cooper

expose: Update wording to reflect multi-service support Also, update comments in the protobuf to reflect changes in how it is used for ExposedTunnel.

Commit:1b74c14
Author:Kevin Lin
Committer:Christopher Cooper

proto: Make BlimpUpPreview return a stream of the CLI output

Commit:2a3627c
Author:Kevin Lin
Committer:Christopher Cooper

proto: Make BlimpUpPreview take environment variables

Commit:18af4ce
Author:Kevin Lin
Committer:Kevin Lin

proto: Add RPCs for booting preview This adds the BlimpUpPreview RPC, which will be implemented by the server.

Commit:98464ba
Author:Kevin Lin
Committer:Kevin Lin

proto: Add compose files option to BlimpUpPreview This makes it possible to work with projects that don't have their compose files at `docker-compose.yml` in the root of the repo.

Commit:512ca77
Author:Kevin Lin
Committer:Kevin Lin

proto: Add RPCs for booting preview This adds the BlimpUpPreview RPC, which will be implemented by the server.

Commit:c428bb0
Author:Kevin Lin
Committer:Christopher Cooper

proto: Add RPCs for interacting with buildkit

Commit:54afcfd
Author:Christopher Cooper
Committer:Kevin Lin

proto: Add ExposedTunnel to node RPCs This will be used by internal Blimp components to facilitate exposed ports.

Commit:f0ebdfb
Author:Christopher Cooper
Committer:Kevin Lin

cli: Add `blimp expose` command This allows you to expose an HTTP service over at a publicly available domain, protected with HTTPS.

Commit:a95587a
Author:Christopher Cooper
Committer:Kevin Lin

status: Add "Preparing" phase to sandbox status This allows us to report when a sandbox has been created but service have not yet been deployed.

Commit:599e624
Author:Kevin Lin
Committer:Kevin Lin

proto: Add method for attaching to sandbox This allows clients to get the connection information necessary to connect to a sandbox, without doing a full deployment.

Commit:82012fd
Author:Kevin Lin
Committer:Kevin Lin

down: Add --volumes flag for deleting volumes A recent change in the backend made it so volumes are persisted across `blimp down`s. This commit makes it possible to clear the volumes with `blimp down -v`.

Commit:0360aa4
Author:Christopher Cooper
Committer:Kevin Lin

status: Report unschedulable pods This gives a better error message in edge cases where some pods in a sandbox may be unschedulable.

Commit:ee432de
Author:Christopher Cooper
Committer:Kevin Lin

build: Pre-push base images Before, image pushes could be very slow, especially on bad internet connections. Now, blimp asks the cluster-controller to pre-push the base image as defined in the Dockerfile for any custom imges. Then, when the custom image is pushed, Docker will recognize that the layers from the base image are already present on the registry, and will not push these layers. Co-authored-by: Kevin Lin <kevin@kelda.io>

Commit:9ee0cac
Author:Christopher Cooper
Committer:Kevin Lin

cli: Add `blimp restart` This will let you restart the pod for an individual service.

Commit:149d031
Author:Kevin Lin
Committer:Kevin Lin

cli: Remove from repo The CLI has been pulled into a separate repo.

Commit:e6845db
Author:Kevin Lin
Committer:Kevin Lin

Fork code from old repo

Commit:623e0b6
Author:Christopher Cooper
Committer:Kevin Lin

wait: Convert DependsOn to a slice This allows us to sort the values, which makes sure that the resulting marshalled wait spec is deterministic. Changes due to go's random iteration order in maps were causing unnecessary pod restart. Co-authored-by: Kevin Lin <kevin@kelda.io>

Commit:e619a41
Author:Kevin Lin
Committer:Kevin Lin

sync: Force the remote volumes to match the local when starting We now initialize Syncthing in two phases: 1) The Syncthing daemon on the local CLI starts in Sendonly mode, and sends Override requests until the remote Syncthing matches the files in the CLI. 2) The CLI Syncthing switches to Sendreceive mode, and does two way sync as normal. This commit also removes the hash-based approach of blocking boot to avoid scenarios where the container starts before Syncthing switches into Sendreceive mode. If we didn't, then any files created by the container while Syncthing was still in Sendonly would get deleted.

Commit:e23ddeb
Author:Kevin Lin
Committer:Kevin Lin

volume: Block boot until volumes are initialized Before, if you booted a compose file where a volume was shared with multiple services, the services would boot independently, so there was no guarantee that the volume would be fully initialized by the time all services started. Compose deals with this by separating boot into two parts -- creating the containers (which includes initializing any attached volumes), and starting them. The containers are only started once _all_ the containers have been created. This commit does something similar, but only blocks boot for services that reference the same volume. Only blocking for services that reference the same volume, rather than all services, should make the boot feel a bit faster for users.

Commit:e697ec1
Author:Kevin Lin
Committer:Kevin Lin

node: Replace sandbox controller with node controller Before, each sandbox had its own public IP that the CLI would connect to in order to send bind volume hash update, and tunnel traffic. However, allocating IPs is serialized by GKE, so that would bottleneck sandbox creations. Plus, there was no way to clean up sandbox state after the namespace is deleted, since the sandbox controller lived in the same namespace as the customer pods. This commit makes it so each Kubernetes node has a controller that handles all the inbound connections from the CLI for all sandboxes running on the node. This controller is also responsible for cleaning up volumes after namespaces are deleted, and ordering boots for customer containers. Note that we still run a per-sandbox DNS server, since our DNS library doesn't allow us to tell what IP made a DNS request.

Commit:412feac
Author:Kevin Lin
Committer:Kevin Lin

down: Wait until sandbox terminates before exiting This is helpful for scripts that run `blimp down` followed by `blimp up`.

Commit:3dc742d
Author:Kevin Lin
Committer:Kevin Lin

compose: Implement healthchecks This commit makes it so we run any healthchecks specified in the Docker Compose file, makes the CLI show the status of the checks, and updates the depends_on logic to respect dependencies on service_healthy.

Commit:b4ebac2
Author:Kevin Lin
Committer:Kevin Lin

manager: Fix protobuf numbering for version check We need it to be backwards compatible so that clients know to upgrade.

Commit:6877e17
Author:Kevin Lin
Committer:Kevin Lin

blimp: Add FriendlyError type This commit adds a new error type that lets us specify a helpful error message to users. When printing errors, blimp automatically looks for any errors that are in the "helpful" format, and print out the message, rather than printing out the full error tree.

Commit:03e0cba
Author:Kevin Lin
Committer:Kevin Lin

status: Handle image pull states better We now tell the user when a pod is stuck in pending because the image failed to pull, and when the image is pulling. To achieve this, the status API now has a Phase field, which has a limited set of valid options, and a Message field, which can contain arbitrary additional information.

Commit:1a7e193
Author:Kevin Lin
Committer:Kevin Lin

volumes: Support mounting individual files This commit rewrites our syncthing approach to allow mounting individual files. Before, we only supported mounting directories. The syncthing pod now syncs all of the files into a single Kubernetes volume. The structure of the volume mirrors the structure of the user's filesystem, and the cluster controller just projects the appropriate pieces of the volume into pods via VolumeMounts. The CLI is responsible for ensuring the files referenced by volumes are synced. For example, when mounting an individual file, the CLI actually syncs the parent directory, and uses a stignore file to ensure that only the file that's being mounted is synced.

Commit:f3f76df
Author:Kevin Lin
Committer:Kevin Lin

login: Rewrite flow for getting credentials Before, the CLI obtained the login token after logging in from the browser by spinning up a local web server, and setting the OAuth redirect URL to localhost. This was brittle, since it depended so heavily on the configuration of people's local system. For example, we ran into people who had other processes listening on the same port locally, and people with odd DNS setups. This commit makes it so the OAuth token is retrieved server-side, and pushed back to the CLI.

Commit:741fe39
Author:Kevin Lin

wait: Properly block container boot on initial volume sync The old code that blocked the container boot didn't work because of a number of incorrect assumptions about the Syncthing API. Because Syncthing doesn't have a concept of "an initial sync", this patch makes it so we determine when the sync is complete by having the CLI publish a hash representing the expected contents of the volume. We then delay starting the user's container until the remote hash matches the expected hash.

Commit:c14cccd
Author:Kevin Lin
Committer:Kevin Lin

build: Remove vendor

Commit:d39b87a
Author:Kevin Lin
Committer:Kevin Lin

cli: Start collecting CLI analytics They now get proxied to the cluster manager, which posts them to DataDog.

Commit:6da7b78
Author:Kevin Lin
Committer:Kevin Lin

dockercompose: Use compose-spec/compose-go

Commit:dcf802c
Author:Kevin Lin
Committer:Kevin Lin

vendor: Add vendor directory

Commit:5a4488c
Author:Kevin Lin
Committer:Kevin Lin

cli: Print a friendlier message if we can't parse Docker Compose file

Commit:a1d75b0
Author:Ethan J. Jackson
Committer:Ethan J. Jackson

cli: Check Version This patch causes the cli to send the manager its version and ask it for instructions how to proceed. Currently the manager always allows the cli to go forward, but this patch lays the groundwork to make different decisions later as needed.

Commit:10859cc
Author:Kevin Lin

volumes: Make volume identifier unique for relative bind volumes Before, if the user switched to a Docker Compose file that was in a different directory, but had a bind volume with the same relative path (e.g. `.`), Blimp would use the same host directory for the volume. This would lead to the other volume's files getting synced back to the local filesystem.

Commit:8df493e
Author:Kevin Lin
Committer:Kevin Lin

volumes: Block booting container until initial volume sync completes Before, it was possible for the volume to start before syncthing synced the local files into the bind volumes, which would cause applications to crash.

Commit:d6dafa5
Author:Kevin Lin

up: Warn if Compose file references unsupported fields

Commit:efb5a35
Author:Kevin Lin

tunnel: Authenticate calls to the tunnel API We now require that the client provide an Auth0 token associated with the target namespace.

Commit:9460e14
Author:Kevin Lin
Committer:Kevin Lin

boot-waiter: Rewrite DependsOn logic to talk to sandbox controller Before, the init container just pinged the containers it depended on. This commit makes it so the init container polls the sandbox controller instead. This lays the foundation for blocking container boot until bind volumes are fully synced.

Commit:dee62e9
Author:Kevin Lin
Committer:Kevin Lin

registry: Forward local registry credentials to the cluster This lets users run private images as long as they're logged in to the registry on their local Docker daemon.

Commit:5101fdd
Author:Kevin Lin
Committer:Kevin Lin

cluster: Make the Docker Compose file available to CreateSandbox Ethan needs it for the Syncthing code.

Commit:d0db99a
Author:Kevin Lin
Committer:Kevin Lin

blimp: Use TLS for all gRPC communication This commit makes it so we use TLS when communicating between the CLI and the cluster manager, and the CLI and the sandbox manager.

Commit:65cd580
Author:Kevin Lin
Committer:Ethan J. Jackson

tunnel: Implement localhost tunneling This patch creates an initial implementation of localhost tunneling. It's likely buggy and a bit fragile, but it's a reasonable starting point.

Commit:8e51bfa
Author:Kevin Lin
Committer:Kevin Lin

down: Add command to delete development sandbox

Commit:77b9b87
Author:Kevin Lin
Committer:Kevin Lin

ps: Add support for getting sandbox status It currently just displays the services and pod phase, but we can now easily add other attributes like uptime.

Commit:8542530
Author:Kevin Lin
Committer:Kevin Lin

Basic scaffolding