diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..f5daa2c --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +FROM mcr.microsoft.com/devcontainers/miniconda:0-3 + +USER vscode +WORKDIR /home/vscode + +# Configure SnowSQL +RUN mkdir .snowsql +COPY .devcontainer/config .snowsql + +# Install SnowSQL +RUN curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.28-linux_x86_64.bash \ + && SNOWSQL_DEST=~/bin SNOWSQL_LOGIN_SHELL=~/.profile bash snowsql-1.2.28-linux_x86_64.bash \ + && rm snowsql-1.2.28-linux_x86_64.bash + +# Create the conda environment +COPY environment.yml . +RUN conda env create \ + && conda init \ + && rm environment.yml \ No newline at end of file diff --git a/.devcontainer/config b/.devcontainer/config new file mode 100644 index 0000000..0248c69 --- /dev/null +++ b/.devcontainer/config @@ -0,0 +1,9 @@ +# SnowSQL config + +[connections.dev] +accountname = myaccount +username = myusername +password = mypassword +rolename = HOL_ROLE +warehousename = HOL_WH +dbname = HOL_DB \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0b65f30 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda +{ + "name": "Snowflake Demo Codespace", + "build": { + "context": "..", + "dockerfile": "Dockerfile" + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [] + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "conda init", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "settings": { + "python.defaultInterpreterPath": "/opt/conda/envs/snowflake-demo", + "python.terminal.activateEnvInCurrentTerminal": true + }, + "extensions": [ + "snowflake.snowflake-vsc" + ] + } + } + } \ No newline at end of file diff --git a/.github/workflows/build_and_deploy.yaml b/.github/workflows/build_and_deploy.yaml index d8bdfde..f4d5478 100644 --- a/.github/workflows/build_and_deploy.yaml +++ b/.github/workflows/build_and_deploy.yaml @@ -18,10 +18,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup Python 3.8 + - name: Setup Python 3.10 uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.10' - name: Install Python packages run: pip install -r requirements.txt diff --git a/LEGAL.md b/LEGAL.md new file mode 100644 index 0000000..e52a5f1 --- /dev/null +++ b/LEGAL.md @@ -0,0 +1 @@ +This application is not part of the Snowflake Service and is governed by the terms in LICENSE, unless expressly agreed to in writing. You use this application at your own risk, and Snowflake has no obligation to support your use of this application. diff --git a/conda_env.yml b/environment.yml similarity index 77% rename from conda_env.yml rename to environment.yml index 40058a0..fc474ba 100644 --- a/conda_env.yml +++ b/environment.yml @@ -3,9 +3,9 @@ channels: - https://repo.anaconda.com/pkgs/snowflake - nodefaults dependencies: - - python=3.8 + - python=3.10 - snowflake-snowpark-python - pip - pip: # Snowflake - - snowflake-cli-labs + - snowflake-cli-labs==0.2.9 diff --git a/requirements.txt b/requirements.txt index a44644d..7364d82 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ snowflake-snowpark-python[pandas] -snowflake-cli-labs +snowflake-cli-labs==0.2.9