Skip to content

Commit

Permalink
SNOW-1360070 upgrade docker container to centOS8 dotnet 8
Browse files Browse the repository at this point in the history
- Upgrade docker file to build cent os 8 with dotnet 8 framework
- Update jenkins file to reference new container
- Update .csproj to compile with dotnet 8
  • Loading branch information
sfc-gh-erojaslizano committed May 3, 2024
1 parent 15f4c55 commit 4ec5ab8
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ 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
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net8.0','net6.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:
strategy:
fail-fast: false
matrix:
dotnet: ['net6.0']
dotnet: ['net8.0','net6.0']
cloud_env: ['AZURE', 'GCP', 'AWS']
steps:
- uses: actions/checkout@v3
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-centos8-net8'),
string(name: 'parent_job', value: env.JOB_NAME),
string(name: 'parent_build_number', value: env.BUILD_NUMBER)
]
Expand Down
6 changes: 3 additions & 3 deletions Snowflake.Data.Tests/Snowflake.Data.Tests.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>
<RuntimeFrameworkVersion>6.0.0</RuntimeFrameworkVersion>
<Title>Snowflake.Data.Tests</Title>
<Description>Snowflake Connector for .NET</Description>
Expand Down Expand Up @@ -37,7 +37,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
17 changes: 8 additions & 9 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,13 +11,12 @@
<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>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Apache.Arrow" Version="14.0.2" />
<PackageReference Include="AWSSDK.S3" Version="3.7.0.4" />
Expand All @@ -31,7 +30,7 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.34.0" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net471' Or '$(TargetFramework)' == 'net472'">
<Reference Include="System.Net.Http" />
</ItemGroup>
Expand All @@ -45,7 +44,7 @@
<!--needed by Moq to be able to mock internal interfaces-->
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
Expand All @@ -55,13 +54,13 @@
<DebugType>full</DebugType>
<DebugSymbols>True</DebugSymbols>
</PropertyGroup>

<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<AssemblyVersion>$(Version)</AssemblyVersion>
</PropertyGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
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-centos8-net8]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos8-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-centos8-net8]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos8-net8-test:$TEST_IMAGE_VERSION
)
export TEST_IMAGE_NAMES
47 changes: 0 additions & 47 deletions ci/image/Dockerfile.dotnet-centos7-net6-build

This file was deleted.

51 changes: 51 additions & 0 deletions ci/image/Dockerfile.dotnet-centos8-net8-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM centos:8

USER root
WORKDIR /

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

# update OS and install basic tools
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*
RUN dnf install centos-release-stream -y
RUN dnf swap centos-{linux,stream}-repos -y
RUN dnf distro-sync -y
RUN yum -y install git
RUN yum -y install which
RUN yum -y install zstd
RUN yum -y install jq

# python
RUN yum -y install python36
RUN python3 -V
RUN pip3 install -U pip
RUN pip3 install wheel

# aws
RUN pip3 install -U awscli
RUN aws --version

# Install .NET SDK 8.0
RUN yum install -y curl tar
RUN rpm -Uvh https://packages.microsoft.com/config/centos/8/packages-microsoft-prod.rpm
RUN yum install -y dotnet-sdk-8.0

# gosu
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64"
RUN chmod +x /usr/local/bin/gosu

# 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"]

# Install build tools
RUN yum -y groupinstall 'Development Tools'
RUN dnf install gcc
SHELL [ "/usr/bin/scl", "enable", "devtoolset-8"]

# workspace
WORKDIR /home/user
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-centos8-net8-build:1

0 comments on commit 4ec5ab8

Please sign in to comment.