From d30d336fa32a0cb9aecc3330d863275cf8ee01cb Mon Sep 17 00:00:00 2001 From: Vladimir Timofeenko Date: Fri, 26 Jan 2024 11:21:25 -0800 Subject: [PATCH] doc: add non-nix instructions and information --- README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b5884f9..95ef5d5 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ with bash as a webshell: # How to +There are two sample images provided: + +- Nix-based one +- [Debian-based one](./non-nix/Dockerfile) + +The instructions below could be applied to either one of them + ## Initial setup Follow the [common setup](https://docs.snowflake.com/developer-guide/snowpark-container-services/tutorials/common-setup) @@ -25,7 +32,7 @@ tutorial to have the image repository and a compute pool in your account. repository - `SNOWFLAKE_PASSWORD`: password for `SNOWFLAKE_USER` -3. Run "Build and push image to Snowflake" action +3. Run "Build and push image to Snowflake" action for the chosen image ## Without Github actions @@ -33,6 +40,8 @@ SPCS (at the time of writing) only works with `x86_64` images. So, on an M1 machine you would need access to a remote builder capable of building `x86_64` packages – for example a virtual machine. +### Nix-based workflow + The nix-based image requires [`nix`](https://nixos.org/download). 1. Have `nix` available (optionally with `direnv`) @@ -46,6 +55,12 @@ The nix-based image requires [`nix`](https://nixos.org/download). 4. Run `nix run #buildAndPushToSpcs -- "ttydContainer"` +### Docker-based workflow + +Change directory to `./non-nix/` and follow the "Build image and upload" steps +from [Snowpark container services +tutorial](https://docs.snowflake.com/en/developer-guide/snowpark-container-services/tutorials/tutorial-1#build-an-image-and-upload). + ## Final steps After the image has been pushed to Snowflake (through action or from local @@ -60,7 +75,7 @@ machine). spec: containers: - name: - image: />///nix-ttydcontainer:latest + image: />///:latest command: - "ttyd" - "--port=8000" @@ -73,6 +88,9 @@ machine). $$; ``` + where `` is `nix-ttydcontainer` or `ttydcontainer`. Check + action logs for the specific value. + 2. Wait for endpoints provisioning to complete (you can monitor the output of `SHOW ENDPOINTS IN SERVICE `) 3. Open the `ttyd` endpoint URL @@ -101,8 +119,10 @@ To add/remove a package to the container, edit the [container definition](./packages/ttydContainer/package.nix) file and rerun the pipeline. -# Running without Nix +# Running without Nix (general instructions) The main mechanism through which the shell is displayed in the browser is [ttyd](https://tsl0922.github.io/ttyd/) which can be added to any other Docker image. + +A sample Debian-based image is provided in this repo.