Platform Guide for Snowflake
End-to-end guide to running Zingg on Snowflake using Snowflake as your data source on AWS EC2 with Docker (Community) or running Zingg natively inside Snowflake with Enterprise.
This guide requires an AWS account with EC2 and Lambda access, and a Snowflake account. Ensure your EC2 security group allows outbound HTTPS (port 443) for Snowflake connectivity. A t3.medium or larger EC2 instance is sufficient for labeling and training phases. For large datasets (1M+ records) use m5.xlarge or above.
Step 1: Set up Zingg on AWS EC2
Create or use an existing EC2 instance. Connect to it using VS Code Remote SSH:
Install the VS Code Remote SSH extension.
Add your EC2 host to the SSH config file:
Host <IP address of EC2 instance>
HostName <hostname of EC2 instance>
User ec2-user
IdentityFile <path to.pem key file>
PreferredAuthentications publickeyClick Open a Remote Window in VS Code, select your EC2 host, and connect. 4. Pull the Zingg Docker image and start a bash session inside the container:
docker pull zingg/zingg:0.6.0
docker run -it zingg/zingg:0.6.0 bashInside the container, your container ID is the alphanumeric string between @ and : in the terminal prompt. For example in root@fab997383957:/zingg#, the container ID is fab997383957. Note this value—you will need it in Step 3.
Before connecting to Snowflake, download the Snowflake Spark connector JAR and the Snowflake JDBC driver and add them to zingg.conf inside the container:
spark.jars=snowflake-jdbc-3.13.19.jar,spark-snowflake_2.12-2.10.0-spark_3.1.jarStep 2: Connect Zingg to Snowflake
Configure your config.json with your Snowflake connection details, field definitions, and performance settings. Use examples/febrl/configSnow.json as a starting point.
Step 3: Create an AWS Lambda function to trigger Zingg phases
The Lambda function receives a Zingg phase name, SSHes into EC2, and executes that phase inside the Docker container. findTrainingData, train, and match run via Lambda. The label phase runs interactively on EC2 directly.
Create a file called lambda_function.py with the following code. Replace all placeholder values before deploying:
Step 4: Deploy the Lambda function
Inside EC2, create a virtual environment and install dependencies:
Go to AWS Lambda → Create Function. Give it a name and select Python. Create a new role with basic Lambda permissions.
Upload the
deploy.zipvia Upload From →.zipfile.Test the function with this Event JSON:
IMAGE TO BE ADDED — AWS Lambda function test screen showing a successful HTTP 200 response with the "Started phase: findTrainingData" body. Tanwi to check with team for screenshot this from a live Lambda test run and add here. Caption: "Lambda function test returning HTTP 200 — Zingg phase started successfully."
Step 5: Connect Lambda to Snowflake via external function
Create a new IAM role. Entity type: Another AWS account. Specify your AWS Account ID.
Create an AWS API Gateway: REST API with regional endpoint. Create a resource with a POST method. Integration type: Lambda function with Lambda proxy integration.
Deploy the API and note the invoke URL.
In Snowflake, get the API integration ARN to update the IAM trust relationship:
Take the API_AWS_ROLE_ARN value from the output and add it as a trusted entity in the IAM role trust policy. This authorises Snowflake's AWS account to assume the role and invoke the Lambda function.
Create the external function in Snowflake:
Step 6: Run Zingg phases from Snowflake
Run findTrainingData
Run label interactively on EC2 directly
Run train
Run match
Check logs from Snowflake
Running phases asynchronously
For large tables, Zingg phases can run for several hours. The SSH connection will time out and kill the job if you run synchronously. Use nohup to run phases as background processes on EC2:
Monitor progress from EC2:
Or from Snowflake:
Snowflake Iceberg Tables variant
This variant uses Azure Blob Storage as the Iceberg storage layer with Snowflake managing the Iceberg tables and Zingg running locally via Docker.
Prerequisites:
Active Azure Blob Storage account with a container
Snowflake account with a warehouse and database
Step 1: Create the Iceberg setup in Snowflake
Create an Azure Blob Storage account and container. Note the storage account name and container name.
In Snowflake: create a warehouse, database, and external volume pointing to Azure Blob Storage.
Run
DESC VOLUME <volume_name>and click theAZURE_CONSENT_URLto authorise Snowflake access to Azure storage.Note the
AZURE_MULTI_TENANT_APP_NAMEvalue (before the underscore) and add it as a role assignment in your Azure storage account.Verify:
SYSTEM$VERIFY_EXTERNAL_VOLUME('your_volume_name').Create your Iceberg table and load your data.
Step 2: Configure Zingg
Zingg accesses Snowflake Iceberg tables through the same Snowflake Spark connector as standard Snowflake tables. The Iceberg layer is transparent to Zingg — reference the Iceberg table by name in dbtable exactly as you would a regular Snowflake table. Ensure Snowflake has been authorised to access your Azure Blob Storage external volume before running any Zingg phase.
Step 3: Run Zingg phases
Same as the main guide above; pull the Zingg Docker image, configure Lambda, and invoke phases from Snowflake.
Zingg Enterprise on Snowflake
Zingg Enterprise runs entirely inside Snowflake using Snowpark Container Services. No data leaves your Snowflake account.
1. Account setup (ACCOUNTADMIN)
2. Network, compute pool and image repository
3. Push the Zingg image
4. Upload artifacts
Service/job YAML spec files
@specs/
Config JSON files, zingg.license, <conn>.properties, set_env.sh
@volumes/zingg-persist/
Connection properties file:
5. Run findTrainingData, train and match (job service)
<PHASE> is findTrainingData, train, match or runIncremental. <CONFIG_NAME> is the config file name without .json.
6. Run label (CLI service)
Open the ingress URL with /zingg appended, log in as zingg, then run:
Last updated
Was this helpful?