Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Tabs, TabItem } from '@astrojs/starlight/components';

This guide explains how to set up the Snowflake emulator in a continuous integration (CI) environment. You can use the emulator to test your Snowflake integration without connecting to the real Snowflake instance.

To install the Snowflake emulator, you need to set up the LocalStack CLI and pull the Docker image. After starting the Docker container, an endpoint (`snowflake.localhost.localstack.cloud`) is made available to connect to the emulated Snowflake instance, which you can use to test your data integrations in CI environments.
To install the Snowflake emulator, you need to set up the [`lstk` CLI](/aws/developer-tools/running-localstack/lstk/), which authenticates, pulls the Docker image, and starts the container for you. After starting the Docker container, an endpoint (`snowflake.localhost.localstack.cloud`) is made available to connect to the emulated Snowflake instance, which you can use to test your data integrations in CI environments.

## Configure the LocalStack CI Key

Expand Down Expand Up @@ -41,12 +41,9 @@ jobs:
- uses: actions/checkout@v3

- name: Start Snowflake emulator
run:
docker pull localstack/snowflake:latest
pip install localstack
localstack start --stack snowflake -d
echo "Waiting for LocalStack startup..."
localstack wait -t 15
run: |
npm install -g @localstack/lstk
lstk start --type snowflake --timeout 90s
echo "Startup complete"
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
Expand All @@ -56,9 +53,6 @@ jobs:
```yaml showLineNumbers
version: 2.1

orbs:
python: circleci/python@2.0.3

jobs:
example-job:
machine:
Expand All @@ -68,15 +62,11 @@ jobs:
- checkout

- run:
name: Start LocalStack
name: Start Snowflake emulator
command: |
pip3 install localstack
docker pull localstack/snowflake
localstack start --stack snowflake -d

echo "Waiting for LocalStack startup..."
localstack wait -t 30
echo "Startup complete"
npm install -g @localstack/lstk
lstk start --type snowflake --timeout 90s
echo "Startup complete"

workflows:
version: 2
Expand Down Expand Up @@ -106,14 +96,12 @@ test:

before_script:
- apk update
- apk add gcc musl-dev linux-headers py3-pip python3 python3-dev
- python3 -m pip install localstack
- apk add --no-cache nodejs npm
- npm install -g @localstack/lstk
script:
- docker pull localstack/snowflake:latest
- dind_ip="$(getent hosts docker | cut -d' ' -f1)"
- echo "${dind_ip} localhost.localstack.cloud " >> /etc/hosts
- DOCKER_HOST="tcp://${dind_ip}:2375" localstack start --stack snowflake -d
- localstack wait -t 15
- DOCKER_HOST="tcp://${dind_ip}:2375" lstk start --type snowflake --timeout 90s
```
</TabItem>
</Tabs>
Loading