Skip to content

Commit

Permalink
Merge branch 'master' into pool/SNOW-860872-connection-pool
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed May 23, 2024
2 parents b6e598f + abb5c4a commit 921b9df
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 33 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
DOTNET_VERSION: 6.0
DOTNET_LEGACY_VERSION: 4.7.1

jobs:
run-linter:
name: Run linter
Expand All @@ -33,7 +29,7 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x"
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Run linters
uses: wearerequired/lint-action@v2
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
DOTNET_VERSION: 6.0
DOTNET_LEGACY_VERSION: 4.7.1
# uncomment to run the tests sequentially
#SEQUENTIAL_ENV: SEQUENTIAL_TEST_RUN

Expand All @@ -34,15 +31,17 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0', 'net472', 'net471']
dotnet: ['net8.0','net6.0', 'net472', 'net471']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -93,14 +92,16 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net6.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -150,14 +151,16 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net6.0', 'net8.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
8.0.x
dotnet-quality: 'ga'
- name: Setup Python
uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ timestamps {
string(name: 'branch', value: 'main'),
string(name: 'client_git_commit', value: scmInfo.GIT_COMMIT),
string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH),
string(name: 'TARGET_DOCKER_TEST_IMAGE', value: 'dotnet-centos7-net6'),
string(name: 'TARGET_DOCKER_TEST_IMAGE', value: 'dotnet-ubuntu204-net8'),
string(name: 'parent_job', value: env.JOB_NAME),
string(name: 'parent_build_number', value: env.BUILD_NUMBER)
]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The Snowflake .NET connector supports the the following .NET framework and libra
- .NET Framework 4.7.1
- .NET Framework 4.7.2
- .NET 6.0
- .NET 8.0

Please refer to the [Notice](#notice) section below for information about safe usage of the .NET Driver

Expand Down
11 changes: 5 additions & 6 deletions Snowflake.Data.Tests/Snowflake.Data.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net8.0</TargetFrameworks>
<RuntimeFrameworkVersion>6.0.0</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</RuntimeFrameworkVersion>
<Title>Snowflake.Data.Tests</Title>
<Description>Snowflake Connector for .NET</Description>
<Company>Snowflake Computing, Inc</Company>
<Product>Snowflake Connector for .NET</Product>
<Copyright>Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.</Copyright>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<LangVersion>9</LangVersion>
<DefineConstants>$(SEQUENTIAL_ENV)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JunitXml.TestLogger" Version="3.1.12" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="6.0.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Expand All @@ -37,7 +36,7 @@
<Reference Include="System.Web" />
<Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
Expand Down
7 changes: 3 additions & 4 deletions Snowflake.Data/Snowflake.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net471;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net6.0;net8.0</TargetFrameworks>
<Title>Snowflake.Data</Title>
<PackageId>Snowflake.Data</PackageId>
<PackageLicenseUrl>https://github.com/snowflakedb/snowflake-connector-net/blob/master/LICENSE</PackageLicenseUrl>
Expand All @@ -11,8 +11,7 @@
<Description>Snowflake Connector for .NET</Description>
<Company>Snowflake Computing, Inc</Company>
<Product>Snowflake Connector for .NET</Product>
<Authors>howryu, tchen</Authors>
<Copyright>Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved.</Copyright>
<Authors>Snowflake</Authors>
<Version>3.1.0</Version>
<DebugType>Full</DebugType>
<LangVersion>7.3</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions ci/_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ BUILD_IMAGE_VERSION=1
TEST_IMAGE_VERSION=1

declare -A BUILD_IMAGE_NAMES=(
[$DRIVER_NAME-centos7-net6]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-net6-build:$BUILD_IMAGE_VERSION
[$DRIVER_NAME-ubuntu204-net8]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-ubuntu204-net8-build:$BUILD_IMAGE_VERSION
)
export BUILD_IMAGE_NAMES

declare -A TEST_IMAGE_NAMES=(
[$DRIVER_NAME-centos7-net6]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-net6-test:$TEST_IMAGE_VERSION
[$DRIVER_NAME-ubuntu204-net8]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-ubuntu204-net8-test:$TEST_IMAGE_VERSION
)
export TEST_IMAGE_NAMES
2 changes: 1 addition & 1 deletion ci/image/Dockerfile.dotnet-centos7-net6-build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN yum -y update && \
yum -y install which && \
yum -y install zstd && \
yum -y install jq \

# python
RUN yum -y install python36
RUN python3 -V
Expand Down
56 changes: 56 additions & 0 deletions ci/image/Dockerfile.dotnet-ubuntu204-net8-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Use the official Ubuntu base image from Docker Hub
FROM ubuntu:20.04

USER root
WORKDIR /

ENV DEBIAN_FRONTEND noninteractive

# create dir for workspace
RUN mkdir -p /home/user
RUN chmod 777 /home/user

# Update packages and install any desired dependencies
RUN apt-get update
RUN apt-get install -y
RUN apt-get install -y wget
RUN apt-get install -y apt-transport-https
RUN apt-get install -y build-essential
RUN apt-get install -y libpng-dev
RUN apt-get install -y libtiff-dev
RUN apt-get install -y libjpeg-dev
RUN apt-get install -y libx11-dev
RUN apt-get install -y libgl1-mesa-dev
RUN apt-get install -y libglu1-mesa-dev
RUN apt-get install -y gcc
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb

# install basic tools
RUN apt-get install -y git
RUN apt-get install -y zstd
RUN apt-get install -y jq

# Install .NET SDK 8.0
RUN apt-get update
RUN apt-get install -y
RUN apt-get install -y dotnet-sdk-6.0
RUN apt-get install -y dotnet-sdk-8.0

# gosu
RUN wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.14/gosu-$(dpkg --print-architecture)" && \
chmod +x /usr/local/bin/gosu && \

# clean up
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*

# workspace
RUN mkdir -p /home/user && \
chmod 777 /home/user
WORKDIR /home/user

# entry point
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM nexus.int.snowflakecomputing.com:8086/docker/client-dotnet-centos7-net6-build:1
FROM nexus.int.snowflakecomputing.com:8086/docker/client-dotnet-ubuntu204-net8-build:1
2 changes: 2 additions & 0 deletions ci/image/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ source $THIS_DIR/../_init.sh

for name in "${!BUILD_IMAGE_NAMES[@]}"; do
docker build \
--platform=linux/amd64 \
--file $THIS_DIR/Dockerfile.$name-build \
--label snowflake \
--label $DRIVER_NAME \
Expand All @@ -16,6 +17,7 @@ done

for name in "${!TEST_IMAGE_NAMES[@]}"; do
docker build \
--platform=linux/amd64 \
--file $THIS_DIR/Dockerfile.$name-test \
--label snowflake \
--label $DRIVER_NAME \
Expand Down

0 comments on commit 921b9df

Please sign in to comment.