Skip to content

Commit cfacdf5

Browse files
authored
chore: remove deprecated runtime dotnetcore3.1 (#5091)
* chore: remove deprecated runtime dotnetcore3.1 * apply pr comments
1 parent 94adeeb commit cfacdf5

32 files changed

+37
-169
lines changed

.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@ coverage.xml
412412

413413
# Temporary scratch directory used by the tests
414414
tests/integration/buildcmd/scratch
415-
tests/integration/testdata/buildcmd/Dotnetcore2.0/bin
416-
tests/integration/testdata/buildcmd/Dotnetcore2.0/obj
417-
tests/integration/testdata/buildcmd/Dotnetcore2.1/bin
418-
tests/integration/testdata/buildcmd/Dotnetcore2.1/obj
419-
tests/integration/testdata/buildcmd/Dotnetcore3.1/bin
420-
tests/integration/testdata/buildcmd/Dotnetcore3.1/obj
421415
tests/integration/testdata/buildcmd/Dotnet6/bin
422416
tests/integration/testdata/buildcmd/Dotnet6/obj
423417
tests/integration/testdata/buildcmd/Dotnet7/bin

designs/build_debug_artifacts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We will introduce a way in `sam build` to produce these debuggable artifacts for
1616
Success criteria for the change
1717
-------------------------------
1818

19-
1. Artifacts generated will be debuggable for runtimes DotNetCore 2.0 and above.
19+
1. Artifacts generated will be debuggable for runtimes DotNet 6.0 and above.
2020

2121
Out-of-Scope
2222
------------

designs/sam_build_cmd.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ build actions. This section will look like:
494494
"build": {
495495
"actions": {
496496
"java8": "gradle build",
497-
"dotnetcore2.1": "./build.sh"
497+
"dotnet6": "./build.sh"
498498
}
499499
}
500500
}

samcli/commands/build/command.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n
5555
3. Ruby 2.7, 3.2 using Bundler\n
5656
4. Java 8, Java 11, Java 17 using Gradle and Maven\n
57-
5. Dotnetcore 3.1, Dotnet6 using Dotnet CLI (without --use-container)\n
57+
5. Dotnet6 using Dotnet CLI (without --use-container)\n
5858
6. Go 1.x using Go Modules (without --use-container)\n
5959
"""
6060

samcli/commands/init/init_templates.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ def get_preprocessed_manifest(
211211
"""
212212
This method get the manifest cloned from the git repo and preprocessed it.
213213
Below is the link to manifest:
214-
https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest.json
214+
https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest-v2.json
215215
The structure of the manifest is shown below:
216216
{
217-
"dotnetcore3.1": [
217+
"dotnet6": [
218218
{
219-
"directory": "dotnetcore3.1/cookiecutter-aws-sam-hello-dotnet",
219+
"directory": "dotnet6/hello",
220220
"displayName": "Hello World Example",
221221
"dependencyManager": "cli-package",
222222
"appTemplate": "hello-world",
223223
"packageType": "Zip",
224-
"useCaseName": "Serverless API"
224+
"useCaseName": "Hello World Example"
225225
},
226226
]
227227
}

samcli/lib/build/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"nodejs10.x",
1111
"dotnetcore2.0",
1212
"dotnetcore2.1",
13+
"dotnetcore3.1",
1314
"python2.7",
1415
"python3.6",
1516
"ruby2.5",

samcli/lib/build/workflow_config.py

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ def get_workflow_config(
161161
"nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
162162
"ruby2.7": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
163163
"ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
164-
"dotnetcore3.1": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
165164
"dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
166165
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),
167166
# When Maven builder exists, add to this list so we can automatically choose a builder based on the supported

samcli/lib/init/local_manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"dotnetcore3.1": [
2+
"dotnet6": [
33
{
44
"directory": "template/cookiecutter-aws-sam-hello-dotnet",
55
"displayName": "Hello World Example",

samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/cookiecutter.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"project_name": "Name of the project",
3-
"runtime": "dotnetcore3.1",
3+
"runtime": "dotnet6",
44
"architectures": {
55
"value": [
66
"x86_64"

samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/HelloWorld.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
{%- else %}
74
<TargetFramework>net6.0</TargetFramework>
8-
{%- endif %}
95
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
106
</PropertyGroup>
117

samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/src/HelloWorld/aws-lambda-tools-defaults.json

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
"profile":"",
1212
"region" : "",
1313
"configuration": "Release",
14-
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
15-
"framework" : "netcoreapp3.1",
16-
{%- endif %}
1714
"function-runtime":"{{ cookiecutter.runtime }}",
1815
"function-memory-size" : 256,
1916
"function-timeout" : 30,

samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Resources:
1414
Properties:
1515
CodeUri: ./src/HelloWorld/
1616
Handler: HelloWorld::HelloWorld.Function::FunctionHandler
17-
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
18-
Runtime: dotnetcore3.1
17+
{%- if cookiecutter.runtime == 'dotnet6' %}
18+
Runtime: dotnet6
1919
{%- endif %}
2020
Architectures:
2121
{%- for arch in cookiecutter.architectures.value %}

samcli/lib/init/templates/cookiecutter-aws-sam-hello-dotnet/{{cookiecutter.project_name}}/test/HelloWorld.Test/HelloWorld.Tests.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
6-
{%- else %}
4+
{%- if cookiecutter.runtime == 'dotnet6' %}
75
<TargetFramework>net6.0</TargetFramework>
86
{%- endif %}
97
</PropertyGroup>

samcli/lib/utils/architecture.py

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"java11": [ARM64, X86_64],
3030
"java17": [ARM64, X86_64],
3131
"go1.x": [X86_64],
32-
"dotnetcore3.1": [ARM64, X86_64],
3332
"dotnet6": [ARM64, X86_64],
3433
"provided": [X86_64],
3534
"provided.al2": [ARM64, X86_64],

samcli/local/common/runtime_template.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
],
4141
"dotnet": [
4242
{
43-
"runtimes": ["dotnet6", "dotnetcore3.1"],
43+
"runtimes": ["dotnet6"],
4444
"dependency_manager": "cli-package",
4545
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-dotnet"),
4646
"build": True,
@@ -96,9 +96,8 @@ def get_local_lambda_images_location(mapping, runtime):
9696
# When adding new Lambda runtimes, please update SAM_RUNTIME_TO_SCHEMAS_CODE_LANG_MAPPING
9797
# Runtimes are ordered in alphabetical fashion with reverse version order (latest versions first)
9898
INIT_RUNTIMES = [
99-
# dotnetcore runtimes in descending order
99+
# dotnet runtimes in descending order
100100
"dotnet6",
101-
"dotnetcore3.1",
102101
"go1.x",
103102
# java runtimes in descending order
104103
"java17",
@@ -126,7 +125,6 @@ def get_local_lambda_images_location(mapping, runtime):
126125

127126
LAMBDA_IMAGES_RUNTIMES_MAP = {
128127
"dotnet6": "amazon/dotnet6-base",
129-
"dotnetcore3.1": "amazon/dotnetcore3.1-base",
130128
"go1.x": "amazon/go1.x-base",
131129
"go (provided.al2)": "amazon/go-provided.al2-base",
132130
"java17": "amazon/java17-base",
@@ -158,7 +156,7 @@ def get_local_lambda_images_location(mapping, runtime):
158156
"python3.8": "Python36",
159157
"python3.9": "Python36",
160158
"python3.10": "Python36",
161-
"dotnet6": "dotnetcore3.1",
159+
"dotnet6": "dotnet6",
162160
"go1.x": "Go1",
163161
}
164162

samcli/local/docker/lambda_debug_settings.py

-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
9393
**_container_env_vars,
9494
},
9595
),
96-
Runtime.dotnetcore31.value: lambda: DebugSettings(
97-
entry + ["/var/runtime/bootstrap"] + debug_args_list,
98-
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},
99-
),
10096
Runtime.dotnet6.value: lambda: DebugSettings(
10197
entry + ["/var/runtime/bootstrap"] + debug_args_list,
10298
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},

samcli/local/docker/lambda_image.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class Runtime(Enum):
4646
java11 = "java11"
4747
java17 = "java17"
4848
go1x = "go1.x"
49-
dotnetcore31 = "dotnetcore3.1"
5049
dotnet6 = "dotnet6"
5150
provided = "provided"
5251
providedal2 = "provided.al2"
@@ -86,7 +85,7 @@ def get_image_name_tag(cls, runtime: str, architecture: str) -> str:
8685
# `provided.al2` becomes `provided:al2``
8786
runtime_image_tag = runtime.replace(".", ":")
8887
elif runtime.startswith("dotnet"):
89-
# dotnetcore3.1 becomes dotnet:core3.1 and dotnet6 becomes dotnet:6
88+
# dotnet6 becomes dotnet:6
9089
runtime_image_tag = runtime.replace("dotnet", "dotnet:")
9190
else:
9291
# This fits most runtimes format: `nameN.M` becomes `name:N.M` (python3.9 -> python:3.9)

tests/integration/buildcmd/test_build_cmd.py

+4-31
Original file line numberDiff line numberDiff line change
@@ -1223,15 +1223,13 @@ class TestBuildCommand_Dotnet_cli_package(BuildIntegBase):
12231223

12241224
@parameterized.expand(
12251225
[
1226-
("dotnetcore3.1", "Dotnetcore3.1", None),
12271226
("dotnet6", "Dotnet6", None),
1228-
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
12291227
("dotnet6", "Dotnet6", "debug"),
12301228
("provided.al2", "Dotnet7", None),
12311229
]
12321230
)
12331231
@pytest.mark.flaky(reruns=3)
1234-
def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_64"):
1232+
def test_dotnet_in_process(self, runtime, code_uri, mode, architecture="x86_64"):
12351233
# dotnet7 requires docker to build the function
12361234
if code_uri == "Dotnet7" and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD):
12371235
self.skipTest(SKIP_DOCKER_MESSAGE)
@@ -1294,9 +1292,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_
12941292

12951293
@parameterized.expand(
12961294
[
1297-
("dotnetcore3.1", "Dotnetcore3.1", None),
12981295
("dotnet6", "Dotnet6", None),
1299-
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
13001296
("dotnet6", "Dotnet6", "debug"),
13011297
# force to run tests on arm64 machines may cause dotnet7 test failing
13021298
# because Native AOT Lambda functions require the host and lambda architectures to match
@@ -1305,7 +1301,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_
13051301
)
13061302
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
13071303
@pytest.mark.flaky(reruns=3)
1308-
def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"):
1304+
def test_dotnet_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"):
13091305
overrides = {
13101306
"Runtime": runtime,
13111307
"CodeUri": code_uri,
@@ -1368,9 +1364,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u
13681364

13691365
@parameterized.expand(
13701366
[
1371-
("dotnetcore3.1", "Dotnetcore3.1", None),
13721367
("dotnet6", "Dotnet6", None),
1373-
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
13741368
("dotnet6", "Dotnet6", "debug"),
13751369
# force to run tests on arm64 machines may cause dotnet7 test failing
13761370
# because Native AOT Lambda functions require the host and lambda architectures to match
@@ -1379,7 +1373,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u
13791373
)
13801374
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
13811375
@pytest.mark.flaky(reruns=3)
1382-
def test_dotnetcore_in_container_mount_with_write_interactive(
1376+
def test_dotnet_in_container_mount_with_write_interactive(
13831377
self,
13841378
runtime,
13851379
code_uri,
@@ -1444,7 +1438,7 @@ def test_dotnetcore_in_container_mount_with_write_interactive(
14441438
)
14451439
self.verify_docker_container_cleanedup(runtime)
14461440

1447-
@parameterized.expand([("dotnetcore3.1", "Dotnetcore3.1"), ("dotnet6", "Dotnet6")])
1441+
@parameterized.expand([("dotnet6", "Dotnet6")])
14481442
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
14491443
@pytest.mark.flaky(reruns=3)
14501444
def test_must_fail_on_container_mount_without_write_interactive(self, runtime, code_uri):
@@ -2045,13 +2039,6 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase):
20452039
@parameterized.expand(
20462040
[
20472041
# in process
2048-
(
2049-
False,
2050-
"Dotnetcore3.1",
2051-
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
2052-
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
2053-
"dotnetcore3.1",
2054-
),
20552042
(
20562043
False,
20572044
"Dotnet6",
@@ -2177,13 +2164,6 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase):
21772164
@parameterized.expand(
21782165
[
21792166
# in process
2180-
(
2181-
False,
2182-
"Dotnetcore3.1",
2183-
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
2184-
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
2185-
"dotnetcore3.1",
2186-
),
21872167
(
21882168
False,
21892169
"Dotnet6",
@@ -2366,13 +2346,6 @@ class TestParallelBuilds(DedupBuildIntegBase):
23662346
@parameterized.expand(
23672347
[
23682348
# in process
2369-
(
2370-
False,
2371-
"Dotnetcore3.1",
2372-
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
2373-
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
2374-
"dotnetcore3.1",
2375-
),
23762349
(
23772350
False,
23782351
"Dotnet6",

tests/integration/testdata/buildcmd/Dotnetcore3.1/HelloWorld.csproj

-16
This file was deleted.

tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs

-44
This file was deleted.

tests/integration/testdata/buildcmd/Dotnetcore3.1/aws-lambda-tools-defaults.json

-19
This file was deleted.

0 commit comments

Comments
 (0)