Skip to content

Commit

Permalink
Merge pull request Snowflake-Labs#20 from sfc-gh-jhansen/main
Browse files Browse the repository at this point in the history
Update to use Codespaces
  • Loading branch information
sfc-gh-jhansen authored Sep 8, 2023
2 parents 7a53695 + 0aee8de commit 75154b6
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .devcontainer/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SnowSQL config

[connections.dev]
accountname = myaccount
username = myusername
password = mypassword
rolename = HOL_ROLE
warehousename = HOL_WH
dbname = HOL_DB
31 changes: 31 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
}
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions conda_env.yml → environment.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: pysnowpark
name: snowflake-demo
channels:
- https://repo.anaconda.com/pkgs/snowflake
- nodefaults
dependencies:
- python=3.8
- python=3.10
- snowflake-snowpark-python
- pip
- pip:
Expand Down

0 comments on commit 75154b6

Please sign in to comment.