Skip to content

Commit 75154b6

Browse files
Merge pull request #20 from sfc-gh-jhansen/main
Update to use Codespaces
2 parents 7a53695 + 0aee8de commit 75154b6

File tree

5 files changed

+63
-4
lines changed

5 files changed

+63
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM mcr.microsoft.com/devcontainers/miniconda:0-3
2+
3+
USER vscode
4+
WORKDIR /home/vscode
5+
6+
# Configure SnowSQL
7+
RUN mkdir .snowsql
8+
COPY .devcontainer/config .snowsql
9+
10+
# Install SnowSQL
11+
RUN curl -O https://sfc-repo.snowflakecomputing.com/snowsql/bootstrap/1.2/linux_x86_64/snowsql-1.2.28-linux_x86_64.bash \
12+
&& SNOWSQL_DEST=~/bin SNOWSQL_LOGIN_SHELL=~/.profile bash snowsql-1.2.28-linux_x86_64.bash \
13+
&& rm snowsql-1.2.28-linux_x86_64.bash
14+
15+
# Create the conda environment
16+
COPY environment.yml .
17+
RUN conda env create \
18+
&& conda init \
19+
&& rm environment.yml

.devcontainer/config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SnowSQL config
2+
3+
[connections.dev]
4+
accountname = myaccount
5+
username = myusername
6+
password = mypassword
7+
rolename = HOL_ROLE
8+
warehousename = HOL_WH
9+
dbname = HOL_DB

.devcontainer/devcontainer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
3+
{
4+
"name": "Snowflake Demo Codespace",
5+
"build": {
6+
"context": "..",
7+
"dockerfile": "Dockerfile"
8+
},
9+
10+
// Features to add to the dev container. More info: https://containers.dev/features.
11+
// "features": {},
12+
13+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
14+
// "forwardPorts": []
15+
16+
// Use 'postCreateCommand' to run commands after the container is created.
17+
// "postCreateCommand": "conda init",
18+
19+
// Configure tool-specific properties.
20+
"customizations": {
21+
"vscode": {
22+
"settings": {
23+
"python.defaultInterpreterPath": "/opt/conda/envs/snowflake-demo",
24+
"python.terminal.activateEnvInCurrentTerminal": true
25+
},
26+
"extensions": [
27+
"snowflake.snowflake-vsc"
28+
]
29+
}
30+
}
31+
}

.github/workflows/build_and_deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3
2020

21-
- name: Setup Python 3.8
21+
- name: Setup Python 3.10
2222
uses: actions/setup-python@v4
2323
with:
24-
python-version: '3.8'
24+
python-version: '3.10'
2525

2626
- name: Install Python packages
2727
run: pip install -r requirements.txt

conda_env.yml renamed to environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
name: pysnowpark
1+
name: snowflake-demo
22
channels:
33
- https://repo.anaconda.com/pkgs/snowflake
44
- nodefaults
55
dependencies:
6-
- python=3.8
6+
- python=3.10
77
- snowflake-snowpark-python
88
- pip
99
- pip:

0 commit comments

Comments
 (0)