Skip to content

Commit 6cad3fd

Browse files
docs: v2 rewrite for snow getting started guide + quickstart updates (#238)
Co-authored-by: Przemek Denkiewicz <67517453+hovaesco@users.noreply.github.com>
1 parent 2e46d5b commit 6cad3fd

File tree

6 files changed

+215
-136
lines changed

6 files changed

+215
-136
lines changed

src/content/docs/snowflake/getting-started/faq.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,31 @@ If you are using the LocalStack for Snowflake in your CI pipelines consistently,
3030

3131
A CI key allows you to use LocalStack in your CI environment. Every activation of a CI key consumes one CI credit. This means that with every build triggered through the LocalStack container you will consume one credit. To use more credits, you can [contact us](https://localstack.cloud/contact) to discuss your requirements.
3232

33+
### How do I enable detailed debug logs?
34+
35+
You can set the `SF_LOG=trace` environment variable in the Snowflake container to enable detailed trace logs that show all the request/response message.
36+
37+
When using `docker-compose` then simply add this variable to the `environment` section of the YAML configuration file.
38+
If you're starting up via the `localstack start` CLI, then make sure to start up via the following configuration:
39+
40+
```bash
41+
DOCKER_FLAGS='-e SF_LOG=trace' DEBUG=1 localstack start --stack snowflake
42+
```
43+
44+
### The `snowflake.localhost.localstack.cloud` hostname doesn't resolve on my machine, what can I do?
45+
46+
On some systems, including some newer versions of MacOS, the domain name `snowflake.localhost.localstack.cloud` may not resolve properly.
47+
If you are encountering network issues and your Snowflake client drivers are unable to connect to the emulator, you may need to manually add the following entry to your `/etc/hosts` file:
48+
49+
```bash
50+
127.0.0.1 snowflake.localhost.localstack.cloud
51+
```
52+
3353
## Support FAQs
3454

35-
### How can I get help with the LocalStack for Snowflake?
55+
### How can I get help with LocalStack for Snowflake?
56+
57+
LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel.
3658

37-
LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel. If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or
59+
If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or
3860
[opening a GitHub issue with the Snowflake tag](https://github.com/localstack/localstack/issues/new?assignees=&labels=type%3A+bug%2Cstatus%3A+triage+needed%2CSnowflake%3A+general&template=bug-report.yml&title=bug%3A+%3Ctitle%3E).

src/content/docs/snowflake/getting-started/index.md

Lines changed: 0 additions & 121 deletions
This file was deleted.
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
title: Installation
3+
description: Installation guide to get started with LocalStack for Snowflake.
4+
template: doc
5+
sidebar:
6+
order: 0
7+
---
8+
9+
import { Code, LinkButton, Tabs, TabItem } from '@astrojs/starlight/components';
10+
import { LOCALSTACK_VERSION } from "astro:env/server";
11+
12+
## LocalStack CLI for Snowflake
13+
14+
The easiest way to get started with LocalStack for Snowflake is by using the LocalStack CLI. It automatically pulls the correct Docker image, manages the container, and supports additional features like image updates and debugging.
15+
16+
## Installing the LocalStack CLI
17+
18+
The LocalStack CLI can be installed using Python, Brew (macOS), or Windows executables.
19+
20+
21+
<Tabs>
22+
23+
<TabItem label="Python" value="python">
24+
25+
If you prefer to install LocalStack via Python (recommended for most Snowflake users), follow the steps below.
26+
27+
Please ensure the following are installed:
28+
29+
- [Python](https://docs.python.org/3/using/index.html) (versions 3.7 to 3.11)
30+
- [pip](https://pip.pypa.io/en/stable/installation/)
31+
32+
Then install the LocalStack CLI:
33+
34+
```bash
35+
python3 -m pip install --upgrade localstack
36+
````
37+
38+
:::note
39+
To download a specific version of LocalStack, replace `<version>` with the required version from [release page](https://github.com/localstack/localstack/releases).
40+
41+
```bash
42+
python3 -m pip install localstack==<version>
43+
```
44+
:::
45+
46+
47+
:::tip[MacOS Sierra?]
48+
If you have problems with permissions in MacOS X Sierra, install with:
49+
50+
```bash
51+
python3 -m pip install --user localstack
52+
```
53+
:::
54+
55+
:::danger
56+
Do not use `sudo` or the `root` user when starting LocalStack.
57+
It should be installed and started entirely under a local non-root user.
58+
:::
59+
60+
</TabItem>
61+
62+
<TabItem label="macOS" value="macos">
63+
64+
You can install the LocalStack CLI using Homebrew:
65+
66+
```bash
67+
brew install localstack/tap/localstack-cli
68+
```
69+
70+
<details>
71+
<summary>Alternative: Binary Download</summary>
72+
73+
Download the binary for your architecture:
74+
75+
<LinkButton href={`https://github.com/localstack/localstack-cli/releases/download/v${LOCALSTACK_VERSION}/localstack-cli-${LOCALSTACK_VERSION}-darwin-amd64-onefile.tar.gz`} icon="download" variant="minimal">Intel (AMD64)</LinkButton>
76+
77+
Then extract it:
78+
79+
<Code code={`sudo tar xvzf localstack-cli-${LOCALSTACK_VERSION}-darwin-*-onefile.tar.gz -C /usr/local/bin`} lang="bash" />
80+
81+
</details>
82+
83+
</TabItem>
84+
85+
<TabItem label="Windows" value="windows">
86+
87+
You can download the pre-built binary below:
88+
89+
<LinkButton href={`https://github.com/localstack/localstack-cli/releases/download/v${LOCALSTACK_VERSION}/localstack-cli-${LOCALSTACK_VERSION}-windows-amd64-onefile.zip`} icon="download" variant="minimal">Intel (AMD64)</LinkButton>
90+
91+
Then extract the archive and run the binary in PowerShell.
92+
93+
:::note
94+
You can download and install the Windows executable from our [GitHub Releases](https://github.com/localstack/localstack-cli/releases).
95+
:::
96+
97+
</TabItem>
98+
99+
</Tabs>
100+
101+
102+
Need more options? See our [alternative installation instructions](https://docs.localstack.cloud/snowflake/getting-started/#alternatives).
103+
104+
## Starting the Snowflake Emulator
105+
106+
Once the CLI is installed and your auth token is set, start the Snowflake Emulator with:
107+
108+
```bash
109+
localstack start --stack snowflake
110+
```
111+
112+
This will pull the LocalStack for Snowfalke image and run the Docker image automatically.
113+
114+
:::note
115+
You may also start the LocalStack container using [Docker Compose](https://docs.localstack.cloud/snowflake/getting-started/#alternatives).
116+
:::
117+
118+
### Check if the emulator is running
119+
120+
Run the following command:
121+
122+
```bash
123+
curl -d '{}' snowflake.localhost.localstack.cloud:4566/session
124+
```
125+
126+
Expected response:
127+
128+
```json
129+
{"success": true}
130+
```
131+
132+
133+
## Updating LocalStack
134+
135+
To keep both the CLI and emulator images up to date, run:
136+
137+
```bash
138+
localstack update all
139+
```
140+
141+
If you only want to update the Snowflake image manually (e.g. to pick up a recent fix), you can run:
142+
143+
```bash
144+
docker pull localstack/snowflake:latest
145+
```
146+
147+
148+
## Alternatives
149+
150+
If you prefer Docker Compose, you can start the emulator using the configuration below:
151+
152+
```yaml showLineNumbers
153+
version: "3.8"
154+
155+
services:
156+
localstack:
157+
container_name: "localstack-snowflake"
158+
image: localstack/snowflake
159+
ports:
160+
- "127.0.0.1:4566:4566"
161+
- "127.0.0.1:4510-4559:4510-4559"
162+
- "127.0.0.1:443:443"
163+
environment:
164+
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?}
165+
volumes:
166+
- "./volume:/var/lib/localstack"
167+
```
168+
169+
Start the container with:
170+
171+
```bash
172+
docker-compose up
173+
```
174+
175+
## Next steps
176+
177+
Now that the Snowflake emulator is installed, you can use it for developing and testing your Snowflake data pipelines. Refer to our [Quickstart](/snowflake/getting-started/quickstart/) guide to get started.

src/content/docs/snowflake/getting-started/quickstart.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,19 @@ This guide explains how to set up the Snowflake emulator and use Snowflake CLI t
1818

1919
LocalStack for Snowflake works with popular Snowflake integrations to run your SQL queries. This guide uses the [Snowflake CLI](/snowflake/integrations/snow-cli/), but you can also use [SnowSQL](/snowflake/integrations/snow-sql/), [DBeaver](/snowflake/integrations/dbeaver/) or the [LocalStack Web Application](/snowflake/tooling/user-interface/) for this purpose.
2020

21+
:::note
22+
Each integration link includes the connection instructions needed to work with the emulator. Please be sure to follow those setup steps before running queries.
23+
:::
24+
2125
## Instructions
2226

23-
Before you begin, pull the Snowflake emulator image (`localstack/snowflake`) and start the container:
27+
Before you begin, first start the LocalStack for Snowflake emulator:
2428

2529
```bash
2630
export LOCALSTACK_AUTH_TOKEN=<your_auth_token>
2731
localstack start --stack snowflake
2832
```
2933

30-
Check the emulator's availability by running:
31-
32-
```bash
33-
curl -d '{}' snowflake.localhost.localstack.cloud:4566/session
34-
```
35-
36-
```bash title="Output"
37-
{"success": true}
38-
```
39-
4034
In this quickstart, we'll create a student records database that demonstrates how to:
4135

4236
- Create databases, schemas, and tables
@@ -248,3 +242,10 @@ You can now explore the following resources to learn more about the Snowflake em
248242

249243
- [Features](/snowflake/features/): Learn about the Snowflake emulator's features and how to use them.
250244
- [Capabilities](/snowflake/capabilities/): Find information about the Snowflake emulator's capabilities and how to use them.
245+
246+
:::note
247+
### How can I get help with the LocalStack for Snowflake?
248+
249+
LocalStack for Snowflake is now GA. To get help, you can join the [Slack community](https://localstack.cloud/slack) and share your feedback, questions, and suggestions with the LocalStack team on the `#help` channel. If your team is using LocalStack for Snowflake, you can also request support by [contacting us](https://localstack.cloud/contact) or
250+
[opening a GitHub issue with the Snowflake tag](https://github.com/localstack/localstack/issues/new?assignees=&labels=type%3A+bug%2Cstatus%3A+triage+needed%2CSnowflake%3A+general&template=bug-report.yml&title=bug%3A+%3Ctitle%3E).
251+
:::

src/content/docs/snowflake/tutorials/aws-lambda-localstack-snowpark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The code in this tutorial is available on [GitHub](https://github.com/localstack
1919

2020
## Prerequisites
2121

22-
- [`localstack` CLI](/snowflake/getting-started/#localstack-cli) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/)
22+
- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/)
2323
- [LocalStack for Snowflake](/snowflake/getting-started/)
2424
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) & [`awslocal` wrapper](/aws/integrations/aws-native-tools/aws-cli/#localstack-aws-cli-awslocal)
2525
- Python 3.10 installed locally

src/content/docs/snowflake/tutorials/credit-scoring-with-localstack-snowpark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The Jupyter Notebook and the dataset used in this tutorial are available on [Git
1414

1515
## Prerequisites
1616

17-
- [`localstack` CLI](/snowflake/getting-started/#localstack-cli) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/)
17+
- [`localstack` CLI](/snowflake/getting-started/) with a [`LOCALSTACK_AUTH_TOKEN`](/aws/getting-started/auth-token/)
1818
- [LocalStack for Snowflake](/snowflake/getting-started/)
1919
- [Snowpark](/snowflake/integrations/snowpark) with other Python libraries
2020
- [Jupyter Notebook](https://jupyter.org/install#jupyter-notebook)

0 commit comments

Comments
 (0)