diff --git a/scripts/conda_build_verification/README.md b/scripts/conda_build_verification/README.md new file mode 100644 index 0000000000..81889f7ca3 --- /dev/null +++ b/scripts/conda_build_verification/README.md @@ -0,0 +1,311 @@ +# Conda Build Verification + +This directory contains scripts for Docker-based verification of Snowflake Snowpark Python conda packages across different architectures using the `continuumio/miniconda3` Docker image. + +## Overview + +The verification system automatically tests conda packages (.conda and .tar.bz2 formats) for **all Python versions 3.9-3.13** on both x86_64 and aarch64 architectures by: + +1. Scanning the `package/` directory for conda packages in `linux-64`, `linux-aarch64`, and `noarch` subdirectories +2. Launching Docker containers using `continuumio/miniconda3` (supports both architectures) +3. Installing packages and their dependencies +4. Running smoke tests with actual Snowflake connection to verify full functionality + +**Note**: A valid `parameters.py` file with Snowflake connection parameters is required for all testing. + +## Files + +- `conda_build_verification.sh` - Main orchestration script +- `docker_verify.sh` - Internal script that runs inside Docker containers +- `smoke_test.py` - Smoke test script for package verification +- `parameters.py` - **Required** Snowflake connection parameters - must be created manually +- `package/` - Directory containing conda packages organized by architecture + +## Package Structure + +The verification expects packages to be organized as follows: +``` +package/ +├── linux-64/ # x86_64 packages +│ ├── snowflake-snowpark-python-1.38.0-py39_0.conda +│ ├── snowflake-snowpark-python-1.38.0-py310_0.conda +│ ├── snowflake-snowpark-python-1.38.0-py311_0.conda +│ ├── snowflake-snowpark-python-1.38.0-py312_0.conda +│ ├── snowflake-snowpark-python-1.38.0-py313_0.conda +│ └── ... (corresponding .tar.bz2 files) +├── linux-aarch64/ # aarch64 packages +│ ├── snowflake-snowpark-python-1.38.0-py39_0.conda +│ ├── snowflake-snowpark-python-1.38.0-py310_0.conda +│ └── ... (all Python versions 3.9-3.13) +└── noarch/ # Architecture-independent packages + ├── snowflake-snowpark-python-1.39.0-py39_0.conda + ├── snowflake-snowpark-python-1.39.0-py310_0.conda + └── ... (all Python versions 3.9-3.13) +``` + +## Usage + +### Basic Usage + +**Prerequisites**: Ensure you have created `parameters.py` with valid Snowflake connection parameters (see Required Setup section above). + +```bash +# Test all Python versions (3.9-3.13) on noarch only +./conda_build_verification.sh + +# Test all Python versions on specific architecture(s) +./conda_build_verification.sh linux-64 +./conda_build_verification.sh linux-64 noarch +./conda_build_verification.sh linux-64 linux-aarch64 noarch +``` + +### Required Setup + +**Before running any verification**, you need a `parameters.py` file with Snowflake connection parameters. You have two options: + +#### Option 1: Automatic GPG Decryption (Recommended for CI/CD) +If you have access to the encrypted parameters file and GPG key: +```bash +export GPG_KEY="your-gpg-passphrase" +./conda_build_verification.sh # Automatically decrypts parameters.py.gpg +``` + +#### Option 2: Manual Creation +Manually create a `parameters.py` file in the `conda_build_verification/` directory: + +```python +# parameters.py +CONNECTION_PARAMETERS = { + "user": "your_username", + "password": "your_password", + "account": "your_account", + "warehouse": "your_warehouse", + "database": "your_database", + "schema": "your_schema" +} +``` + +Then run verification: + +```bash +# Run verification on default architecture (noarch) for all Python versions +./conda_build_verification.sh + +# Run verification on specific architectures for all Python versions +./conda_build_verification.sh linux-64 noarch +``` + +### Command Line Syntax + +```bash +./conda_build_verification.sh [architecture...] +``` + +**Parameters:** +- `architecture...` (optional): One or more architecture directories to test + - Available: `linux-64`, `linux-aarch64`, `noarch` + - Default: `noarch` only if no architectures specified +- **Python versions**: Automatically tests all Python versions 3.9-3.13 + +**Examples:** +- `./conda_build_verification.sh` → Test all Python versions (3.9-3.13) on noarch +- `./conda_build_verification.sh linux-64` → Test all Python versions on linux-64 only +- `./conda_build_verification.sh linux-64 noarch` → Test all Python versions on both linux-64 and noarch +- `./conda_build_verification.sh linux-64 linux-aarch64 noarch` → Test all Python versions on all architectures + +### Environment Variables + +- `GPG_KEY` - (Optional) Passphrase for automatically decrypting `scripts/parameters.py.gpg` + +## Docker Requirements + +- Docker must be installed and accessible +- Docker daemon must be running +- Internet access for pulling `continuumio/miniconda3` image + +## How It Works + +1. **Prerequisites Validation**: + - Checks for Docker availability + - Attempts GPG decryption of `parameters.py.gpg` if `GPG_KEY` environment variable is set + - Validates `parameters.py` file existence and provides helpful error messages if missing + - Fails fast before any Docker operations begin + +2. **Package Discovery**: Scans `package/linux-64`, `package/linux-aarch64`, and `package/noarch` for packages across all Python versions (3.9-3.13) + - **Strict Validation**: If packages are not found in any requested architecture directory, the script errors out immediately + +3. **Docker Container Launch**: For each architecture with packages: + - Launches `continuumio/miniconda3` container with appropriate `--platform` flag + - **Cross-platform testing**: Can test aarch64 packages on x86_64 hosts and vice versa + - Mounts verification scripts and package directory + - Runs `docker_verify.sh` inside the container + +4. **Package Testing**: Inside each container, for each Python version (3.9-3.13): + - Creates isolated conda environment for the specific Python version + - Installs package dependencies + - Installs the conda package (.conda and .tar.bz2 formats) if available for that version + - Runs smoke tests for that version + - Reports results per Python version + +5. **Smoke Testing**: + - Connects to Snowflake using the `parameters.py` configuration + - Runs a test query (`SELECT 1 as A`) to verify full functionality + - Validates that the installed package can successfully interact with Snowflake + +6. **Cleanup**: Removes containers and temporary files + +## Architecture Support + +The `continuumio/miniconda3` Docker image supports both: +- **x86_64** (Intel/AMD 64-bit) +- **aarch64** (ARM 64-bit, Apple Silicon, ARM servers) + +Docker uses the `--platform` flag to specify the target architecture: +- `linux-64` → `--platform linux/amd64` (x86_64) +- `linux-aarch64` → `--platform linux/arm64` (aarch64) +- `noarch` → `--platform linux/amd64` (x86_64 for compatibility) + +## Example Output + +``` +Testing Python versions: 3.9, 3.10, 3.11, 3.12, 3.13 +Using default architecture: noarch +Testing architectures: noarch +Script directory: /path/to/scripts/conda_build_verification +Project root: /path/to/snowpark-python +GPG_KEY found, attempting to decrypt parameters.py... +✅ Successfully decrypted parameters.py +Starting Docker-based conda package verification... +Found packages in noarch +=== Running verification for noarch === +Found packages in noarch, will test all Python versions (3.9-3.13) +Running Docker command for noarch... + +=== Testing Python 3.9 === +Testing conda package: snowflake-snowpark-python-1.39.0-py39_0.conda +✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py39_0.conda +Testing tar.bz2 package: snowflake-snowpark-python-1.39.0-py39_0.tar.bz2 +✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py39_0.tar.bz2 +✅ All tests passed for Python 3.9 + +=== Testing Python 3.10 === +Testing conda package: snowflake-snowpark-python-1.39.0-py310_0.conda +✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py310_0.conda +Testing tar.bz2 package: snowflake-snowpark-python-1.39.0-py310_0.tar.bz2 +✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py310_0.tar.bz2 +✅ All tests passed for Python 3.10 + +... (similar output for Python 3.11, 3.12, 3.13) + +=== Final Results === +✅ All package tests completed successfully across all Python versions + +✅ Verification successful for noarch +Cleaning up... +Removed decrypted parameters.py +✅ All verifications completed successfully +``` + +## Troubleshooting + +### Common Issues + +1. **Docker not found** + ``` + Error: Docker is not installed or not in PATH + ``` + Install Docker and ensure it's in your PATH. + +2. **No packages found** + ``` + ❌ Error: No packages found in requested architecture: linux-aarch64 + Available packages can be found in: + - linux-64 + - noarch + ``` + This error occurs when the script cannot find packages for a requested architecture directory. + + **To fix**: Ensure packages are in the correct `package/` subdirectories with proper naming patterns (e.g., `snowflake-snowpark-python-*-py39_*.conda`), or use one of the available architectures listed in the error message. + +3. **GPG decryption fails** + ``` + ❌ Error: Failed to decrypt parameters.py.gpg + Please check your GPG_KEY environment variable or create parameters.py manually + ``` + This occurs when GPG decryption fails. Possible causes: + - Incorrect `GPG_KEY` passphrase + - GPG not installed or configured + - Corrupted `.gpg` file + + **To fix**: Verify the GPG_KEY value or create `parameters.py` manually. + +4. **Missing parameters.py.gpg file** + ``` + ❌ Error: parameters.py.gpg not found at /path/to/scripts/parameters.py.gpg + ``` + This occurs when `GPG_KEY` is set but the encrypted file doesn't exist. + + **To fix**: Ensure the encrypted file exists at `scripts/parameters.py.gpg` or create `parameters.py` manually. + +5. **Container startup fails** + Check Docker daemon is running and you have internet access to pull the image. + +6. **Missing parameters.py file** + ``` + ❌ Error: Required file 'parameters.py' not found in /path/to/conda_build_verification/ + + The verification requires a parameters.py file with Snowflake connection parameters. + Please create /path/to/conda_build_verification/parameters.py with the following format: + + CONNECTION_PARAMETERS = { + "user": "your_username", + "password": "your_password", + "account": "your_account", + "warehouse": "your_warehouse", + "database": "your_database", + "schema": "your_schema" + } + ``` + + This error occurs when `parameters.py` is missing from the verification directory. The script now checks for this file early and fails fast. + + **To fix**: Create a `parameters.py` file in the `conda_build_verification/` directory with your connection parameters: + ```python + CONNECTION_PARAMETERS = { + "user": "your_username", + "password": "your_password", + "account": "your_account", + "warehouse": "your_warehouse", + "database": "your_database", + "schema": "your_schema" + } + ``` + +### Manual Testing + +To manually test packages for all Python versions: + +```bash +# Run container interactively +docker run -it --rm \ + -v $(pwd):/verification \ + -v $(pwd)/package/linux-64:/packages \ + -e ARCH_DIR=linux-64 \ + continuumio/miniconda3:latest \ + bash + +# Inside container, run the verification script (tests all Python versions 3.9-3.13) +bash /verification/docker_verify.sh +``` + +## Dependencies + +The verification installs these dependencies inside each test environment: +- cloudpickle<=3.1.1 +- pyyaml +- snowflake-connector-python +- tzlocal +- python-dateutil +- protobuf + +These match the dependencies expected by Snowflake Snowpark Python. diff --git a/scripts/conda_build_verification/conda_build_verification.sh b/scripts/conda_build_verification/conda_build_verification.sh new file mode 100755 index 0000000000..6f502a3c0c --- /dev/null +++ b/scripts/conda_build_verification/conda_build_verification.sh @@ -0,0 +1,236 @@ +#!/bin/bash + +# Docker-based Snowflake Snowpark Python conda package verification +# Supports both x86_64 and aarch64 architectures using continuumio/miniconda3 +# Tests all Python versions (3.9-3.13) automatically +# +# Usage: ./conda_build_verification.sh [architecture...] +# +# Examples: +# ./conda_build_verification.sh # Test all Python versions on noarch only +# ./conda_build_verification.sh linux-64 # Test all Python versions on linux-64 only +# ./conda_build_verification.sh linux-64 noarch linux-aarch64 # Test multiple architectures + +set -e + +# Parse architecture arguments +if [ $# -gt 0 ]; then + # User provided architecture arguments + PACKAGE_DIRS=("$@") + echo "User specified architectures: ${PACKAGE_DIRS[*]}" +else + # Default: test noarch only + PACKAGE_DIRS=("noarch") + echo "Using default architecture: noarch" +fi + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" +PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" + +echo "Testing Python versions: 3.9, 3.10, 3.11, 3.12, 3.13" +echo "Testing architectures: ${PACKAGE_DIRS[*]}" +echo "Script directory: $SCRIPT_DIR" +echo "Project root: $PROJECT_ROOT" + +# Docker image - continuumio/miniconda3 supports both x86_64 and aarch64 +DOCKER_IMAGE="continuumio/miniconda3:latest" + +# Function to check if packages exist in directory +check_packages() { + local dir="$1" + local package_path="${SCRIPT_DIR}/package/${dir}" + + if [ ! -d "$package_path" ]; then + return 1 + fi + + # Check if there are any snowflake-snowpark-python packages + if ls "${package_path}"/snowflake-snowpark-python-*.conda >/dev/null 2>&1 || \ + ls "${package_path}"/snowflake-snowpark-python-*.tar.bz2 >/dev/null 2>&1; then + return 0 + fi + return 1 +} + +# Function to check if any packages exist in directory (for any Python version) +check_any_packages() { + local dir="$1" + local package_path="${SCRIPT_DIR}/package/${dir}" + + if [ ! -d "$package_path" ]; then + return 1 + fi + + # Check if there are any snowflake-snowpark-python packages for any Python version + if ls "${package_path}"/snowflake-snowpark-python-*.conda >/dev/null 2>&1 || \ + ls "${package_path}"/snowflake-snowpark-python-*.tar.bz2 >/dev/null 2>&1; then + return 0 + fi + return 1 +} + +# Function to run Docker verification for an architecture +run_docker_verification() { + local arch_dir="$1" + + echo "=== Running verification for $arch_dir ===" + + # Check if any packages exist for this architecture + if ! check_any_packages "$arch_dir"; then + echo "No packages found in $arch_dir, skipping..." + return 0 + fi + + echo "Found packages in $arch_dir, will test all Python versions (3.9-3.13)" + + # Create container name + local container_name="snowpark-verify-${arch_dir}-$(date +%s)" + + # Determine Docker platform based on architecture + local platform="" + case "$arch_dir" in + "linux-64") + platform="--platform linux/amd64" + ;; + "linux-aarch64") + platform="--platform linux/arm64" + ;; + "noarch") + # For noarch, use x86_64 as default (most compatible) + platform="--platform linux/amd64" + ;; + *) + echo "Warning: Unknown architecture $arch_dir, using host platform" + platform="" + ;; + esac + + # Prepare Docker run command + local docker_cmd="docker run --rm --name $container_name $platform" + + # Mount necessary files and directories + docker_cmd="$docker_cmd -v ${SCRIPT_DIR}:/verification" + docker_cmd="$docker_cmd -v ${SCRIPT_DIR}/package/${arch_dir}:/packages" + + # Add environment variables + docker_cmd="$docker_cmd -e ARCH_DIR=$arch_dir" + + # Use the Docker image + docker_cmd="$docker_cmd $DOCKER_IMAGE" + + # Run the verification script inside the container + docker_cmd="$docker_cmd bash /verification/docker_verify.sh" + + echo "Running Docker command for $arch_dir..." + if eval "$docker_cmd"; then + echo "✅ Verification successful for $arch_dir" + else + echo "❌ Verification failed for $arch_dir" + return 1 + fi +} + +# Global variable to track if parameters.py was decrypted +parameters_decrypted=false + +# Cleanup function for decrypted parameters.py +cleanup_decrypted_parameters() { + if [ "$parameters_decrypted" = true ] && [ -f "${SCRIPT_DIR}/parameters.py" ]; then + rm -f "${SCRIPT_DIR}/parameters.py" + echo "Removed decrypted parameters.py" + fi +} + +# Set up trap to ensure cleanup on script exit or interruption +trap cleanup_decrypted_parameters EXIT INT TERM + +# Main execution +main() { + local verification_failed=false + + # Check for Docker + if ! command -v docker &> /dev/null; then + echo "Error: Docker is not installed or not in PATH" + exit 1 + fi + + # Check for GPG_KEY environment variable and decrypt parameters.py if available + if [ -n "$GPG_KEY" ] && [ ! -f "${SCRIPT_DIR}/parameters.py" ]; then + echo "GPG_KEY found, attempting to decrypt parameters.py..." + if [ -f "${PROJECT_ROOT}/scripts/parameters.py.gpg" ]; then + if gpg --quiet --batch --yes --decrypt --passphrase="$GPG_KEY" --output "${SCRIPT_DIR}/parameters.py" "${PROJECT_ROOT}/scripts/parameters.py.gpg"; then + echo "✅ Successfully decrypted parameters.py" + parameters_decrypted=true + else + echo "❌ Error: Failed to decrypt parameters.py.gpg" + echo "Please check your GPG_KEY environment variable or create parameters.py manually" + exit 1 + fi + else + echo "❌ Error: parameters.py.gpg not found at ${PROJECT_ROOT}/scripts/parameters.py.gpg" + exit 1 + fi + elif [ -n "$GPG_KEY" ] && [ -f "${SCRIPT_DIR}/parameters.py" ]; then + echo "GPG_KEY found but parameters.py already exists, using existing file" + fi + + # Check for required parameters.py file + if [ ! -f "${SCRIPT_DIR}/parameters.py" ]; then + echo "❌ Error: Required file 'parameters.py' not found in ${SCRIPT_DIR}/" + echo "" + echo "The verification requires a parameters.py file with Snowflake connection parameters." + echo "Please create ${SCRIPT_DIR}/parameters.py with the following format:" + echo "" + echo "CONNECTION_PARAMETERS = {" + echo " \"user\": \"your_username\"," + echo " \"password\": \"your_password\"," + echo " \"account\": \"your_account\"," + echo " \"warehouse\": \"your_warehouse\"," + echo " \"database\": \"your_database\"," + echo " \"schema\": \"your_schema\"" + echo "}" + echo "" + exit 1 + fi + + echo "✅ Found parameters.py file" + echo "Starting Docker-based conda package verification..." + + # Check each architecture directory with fallback logic + for dir in "${PACKAGE_DIRS[@]}"; do + local test_dir="" + + if check_any_packages "$dir"; then + echo "Found packages in $dir" + test_dir="$dir" + else + echo "❌ Error: No packages found in requested architecture: $dir" + echo "Available packages can be found in:" + for check_dir in "linux-64" "linux-aarch64" "noarch"; do + if check_any_packages "$check_dir"; then + echo " - $check_dir" + fi + done + echo "❌ Exiting due to no packages found in requested architecture" + exit 1 + fi + + # Run verification for the selected directory + if ! run_docker_verification "$test_dir"; then + verification_failed=true + fi + done + + # Remove any dangling containers + docker container prune -f >/dev/null 2>&1 || true + + if [ "$verification_failed" = true ]; then + echo "❌ Some verifications failed" + exit 1 + else + echo "✅ All verifications completed successfully" + fi +} + +# Run main function +main "$@" diff --git a/scripts/conda_build_verification/docker_verify.sh b/scripts/conda_build_verification/docker_verify.sh new file mode 100755 index 0000000000..4e3cef39cb --- /dev/null +++ b/scripts/conda_build_verification/docker_verify.sh @@ -0,0 +1,166 @@ +#!/bin/bash + +# Docker container verification script for Snowflake Snowpark Python packages +# This script runs inside the continuumio/miniconda3 container to verify conda packages + +set -e + +# List of Python versions to test +PYTHON_VERSIONS=("3.9" "3.10" "3.11" "3.12" "3.13") + +echo "=== Docker Container Verification Script ===" +echo "Python versions to test: ${PYTHON_VERSIONS[*]}" +echo "Architecture directory: ${ARCH_DIR}" +echo "Container: $(uname -a)" +echo "Conda version: $(conda --version)" + +# Function to test a package +test_package() { + local package_path="$1" + local package_type="$2" + local python_version="$3" + + if [ -z "$package_path" ] || [ ! -f "$package_path" ]; then + echo "Package not found: $package_path" + return 1 + fi + + echo "Testing $package_type package: $(basename "$package_path")" + + # Ensure conda is properly set up for this shell + source /opt/conda/etc/profile.d/conda.sh + + # Create test environment + local env_name="test-${package_type}-$$" + echo "Creating conda environment: $env_name" + conda create -n "$env_name" python="$python_version" -y + conda activate "$env_name" + + # Install required dependencies first + echo "Installing dependencies..." + pip install "cloudpickle<=3.1.1" pyyaml snowflake-connector-python tzlocal python-dateutil protobuf + + # Install the package + echo "Installing package: $(basename "$package_path")" + if [ "$package_type" = "conda" ]; then + conda install "$package_path" -y + else + conda install "$package_path" -y + fi + + # Run smoke test and capture output + echo "Running smoke test..." + cd /verification + + # Capture both stdout and stderr, and the exit code + local smoke_test_output + local smoke_test_exit_code + + smoke_test_output=$(python smoke_test.py 2>&1) + smoke_test_exit_code=$? + + if [ $smoke_test_exit_code -eq 0 ]; then + echo "✅ Smoke test successful" + echo "$smoke_test_output" + + # Cleanup environment + conda deactivate + conda env remove -n "$env_name" -y + + echo "✅ Package test completed successfully: $(basename "$package_path")" + else + echo "❌ Smoke test failed with exit code: $smoke_test_exit_code" + echo "Error output:" + echo "$smoke_test_output" + + # Cleanup environment even on failure + conda deactivate || true + conda env remove -n "$env_name" -y || true + + exit 1 + fi +} + +# Function to find packages for the current Python version +find_packages() { + local python_version="$1" + # Convert Python version (e.g., 3.10 -> py310) + local py_version="py$(echo $python_version | tr -d '.')" + + # Find matching packages + local conda_package=$(find /packages -name "snowflake-snowpark-python-*-${py_version}_*.conda" | head -1) + local tar_package=$(find /packages -name "snowflake-snowpark-python-*-${py_version}_*.tar.bz2" | head -1) + + echo "$conda_package:$tar_package" +} + +# Main verification process +main() { + # Initialize conda for this shell session + echo "Initializing conda..." + source /opt/conda/etc/profile.d/conda.sh + echo "✅ Conda initialized successfully" + + local overall_test_failed=false + + # Loop through all Python versions + for python_version in "${PYTHON_VERSIONS[@]}"; do + echo "" + echo "=== Testing Python ${python_version} ===" + + # Find packages to test for this Python version + local packages=$(find_packages "$python_version") + local conda_package=$(echo "$packages" | cut -d':' -f1) + local tar_package=$(echo "$packages" | cut -d':' -f2) + + local version_test_failed=false + + # Skip if no packages found for this version + if [ -z "$conda_package" ] && [ -z "$tar_package" ]; then + echo "⚠️ No packages found for Python $python_version, skipping..." + continue + fi + + # Test .conda package if available + if [ -n "$conda_package" ] && [ -f "$conda_package" ]; then + if ! test_package "$conda_package" "conda" "$python_version"; then + echo "❌ .conda package test failed for Python $python_version" + version_test_failed=true + overall_test_failed=true + fi + else + echo "No .conda package found for Python $python_version" + fi + + # Test .tar.bz2 package if available + if [ -n "$tar_package" ] && [ -f "$tar_package" ]; then + if ! test_package "$tar_package" "tar.bz2" "$python_version"; then + echo "❌ .tar.bz2 package test failed for Python $python_version" + version_test_failed=true + overall_test_failed=true + fi + else + echo "No .tar.bz2 package found for Python $python_version" + fi + + # Report results for this Python version + if [ "$version_test_failed" = false ]; then + echo "✅ All tests passed for Python $python_version" + else + echo "❌ Some tests failed for Python $python_version" + fi + done + + # Final result + echo "" + echo "=== Final Results ===" + if [ "$overall_test_failed" = true ]; then + echo "❌ Some package tests failed across Python versions" + exit 1 + else + echo "✅ All package tests completed successfully across all Python versions" + fi +} + +# Run main function +main "$@" diff --git a/scripts/conda_build_verification/smoke_test.py b/scripts/conda_build_verification/smoke_test.py new file mode 100644 index 0000000000..f941fde559 --- /dev/null +++ b/scripts/conda_build_verification/smoke_test.py @@ -0,0 +1,17 @@ +# +# Copyright (c) 2012-2025 Snowflake Computing Inc. All rights reserved. +# +from snowflake.snowpark import Session +from parameters import CONNECTION_PARAMETERS + + +def run_smoke_test(): + """Run smoke test with or without Snowflake connection""" + # Create session and run test query + session = Session.builder.configs(CONNECTION_PARAMETERS).create() + session.sql("select 1 as A").collect() + session.close() + + +if __name__ == "__main__": + run_smoke_test()