diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index dc328598f..1c00a29aa 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -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 @@ -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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0bd7c6bd..430698154 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile index ba17f8247..2870cb1e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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) ] diff --git a/README.md b/README.md index 9bf9cb945..61975deff 100644 --- a/README.md +++ b/README.md @@ -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 section below for information about safe usage of the .NET Driver @@ -999,7 +1000,7 @@ dotnet-coverage collect "dotnet test --framework net472 --no-build -l console;ve ## Notice -1. CVE-2019-0820 - +1. CVE-2019-0820 - This CVE has been reported in systems.text.regularexpressions.dll which is used by the regular expressions packages - systems.text.regularexpressions.4.3.1.nupkg. This vulnerability manifests itself ONLY when the following .NET runtime environments are being used: * v1.0 branch: 1.0 - 1.0.16 (exclusive) @@ -1009,7 +1010,7 @@ dotnet-coverage collect "dotnet test --framework net472 --no-build -l console;ve In order to mitigate this vulnerability, we recommend to update to higher Runtime versions. If you're already running on a .NET Runtime version higher than the ones listed above, you're not going to be affected by this vulnerability. -2. Logging - +2. Logging - Snowflake has identified an issue on Feb 20, 2020, with our logging code for the .NET drivers in which we write Master and Session tokens in the clear to the debug logs. The debug logs are collected locally on the drive where your programs are running. This issue impacts only those instances where the programs are run with debug flags enabled, i.e. setting the log level value= "Debug” or “All" in the log4Net config Under normal conditions, the Master and Session tokens captured in the log files are short-lived for about 4 and 1 hours, respectively. They will expire after the 4-hour window unless explicitly refreshed, in which case they could be refreshed indefinitely. @@ -1022,8 +1023,8 @@ dotnet-coverage collect "dotnet test --framework net472 --no-build -l console;ve - If you cannot upgrade for any reason, please ensure all debugging is disabled - If you are concerned about a potential compromise, contact Snowflake Customer Support for assistance with invalidating all active sessions/tokens. -3. Global HTTP connection settings - - Snowflake has identified an issue where the driver is globally enforcing TLS 1.2 and certificate revocation checks with the .NET Driver v1.2.1 and earlier versions. +3. Global HTTP connection settings - + Snowflake has identified an issue where the driver is globally enforcing TLS 1.2 and certificate revocation checks with the .NET Driver v1.2.1 and earlier versions. Starting with v2.0.0, the driver will set these locally. Note that the driver is now targeting .NET 6.0. When upgrading, you might also need to run “Update-Package -reinstall” to update the dependencies. diff --git a/Snowflake.Data.Tests/Snowflake.Data.Tests.csproj b/Snowflake.Data.Tests/Snowflake.Data.Tests.csproj index 86decd67a..0188d4552 100644 --- a/Snowflake.Data.Tests/Snowflake.Data.Tests.csproj +++ b/Snowflake.Data.Tests/Snowflake.Data.Tests.csproj @@ -1,23 +1,22 @@  - net6.0;net471;net472 - net6.0 + net8.0;net6.0;net471;net472 + net6.0;net8.0 6.0.0 + 8.0.0 Snowflake.Data.Tests Snowflake Connector for .NET Snowflake Computing, Inc Snowflake Connector for .NET - Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. true 9 $(SEQUENTIAL_ENV) - - + @@ -37,7 +36,7 @@ - + full True diff --git a/Snowflake.Data/Snowflake.Data.csproj b/Snowflake.Data/Snowflake.Data.csproj index 0621c5fb0..4caf957af 100644 --- a/Snowflake.Data/Snowflake.Data.csproj +++ b/Snowflake.Data/Snowflake.Data.csproj @@ -1,7 +1,7 @@  - net6.0;net471;net472 - net6.0 + net8.0;net6.0;net471;net472 + net6.0;net8.0 Snowflake.Data Snowflake.Data https://github.com/snowflakedb/snowflake-connector-net/blob/master/LICENSE @@ -11,13 +11,12 @@ Snowflake Connector for .NET Snowflake Computing, Inc Snowflake Connector for .NET - howryu, tchen - Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. + Snowflake 3.1.0 Full 7.3 - + @@ -31,7 +30,7 @@ - + @@ -45,7 +44,7 @@ - + full True @@ -55,13 +54,13 @@ full True - + true true $(Version) - + diff --git a/ci/_init.sh b/ci/_init.sh index 92d69e682..1b8314100 100755 --- a/ci/_init.sh +++ b/ci/_init.sh @@ -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 diff --git a/ci/image/Dockerfile.dotnet-centos7-net6-build b/ci/image/Dockerfile.dotnet-centos7-net6-build index 85f3bc242..9bc9de834 100644 --- a/ci/image/Dockerfile.dotnet-centos7-net6-build +++ b/ci/image/Dockerfile.dotnet-centos7-net6-build @@ -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 diff --git a/ci/image/Dockerfile.dotnet-ubuntu204-net8-build b/ci/image/Dockerfile.dotnet-ubuntu204-net8-build new file mode 100644 index 000000000..a50523142 --- /dev/null +++ b/ci/image/Dockerfile.dotnet-ubuntu204-net8-build @@ -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"] diff --git a/ci/image/Dockerfile.dotnet-centos7-net6-test b/ci/image/Dockerfile.dotnet-ubuntu204-net8-test similarity index 73% rename from ci/image/Dockerfile.dotnet-centos7-net6-test rename to ci/image/Dockerfile.dotnet-ubuntu204-net8-test index 044227020..05f2c0f3c 100644 --- a/ci/image/Dockerfile.dotnet-centos7-net6-test +++ b/ci/image/Dockerfile.dotnet-ubuntu204-net8-test @@ -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 diff --git a/ci/image/build.sh b/ci/image/build.sh index 049c03772..f5e7dd76d 100755 --- a/ci/image/build.sh +++ b/ci/image/build.sh @@ -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 \ @@ -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 \