Skip to content

Commit

Permalink
chore: remove deprecated runtime dotnetcore3.1 (aws#5091)
Browse files Browse the repository at this point in the history
* chore: remove deprecated runtime dotnetcore3.1

* apply pr comments
  • Loading branch information
moelasmar authored Jun 21, 2023
1 parent 94adeeb commit cfacdf5
Show file tree
Hide file tree
Showing 32 changed files with 37 additions and 169 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,6 @@ coverage.xml

# Temporary scratch directory used by the tests
tests/integration/buildcmd/scratch
tests/integration/testdata/buildcmd/Dotnetcore2.0/bin
tests/integration/testdata/buildcmd/Dotnetcore2.0/obj
tests/integration/testdata/buildcmd/Dotnetcore2.1/bin
tests/integration/testdata/buildcmd/Dotnetcore2.1/obj
tests/integration/testdata/buildcmd/Dotnetcore3.1/bin
tests/integration/testdata/buildcmd/Dotnetcore3.1/obj
tests/integration/testdata/buildcmd/Dotnet6/bin
tests/integration/testdata/buildcmd/Dotnet6/obj
tests/integration/testdata/buildcmd/Dotnet7/bin
Expand Down
2 changes: 1 addition & 1 deletion designs/build_debug_artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We will introduce a way in `sam build` to produce these debuggable artifacts for
Success criteria for the change
-------------------------------

1. Artifacts generated will be debuggable for runtimes DotNetCore 2.0 and above.
1. Artifacts generated will be debuggable for runtimes DotNet 6.0 and above.

Out-of-Scope
------------
Expand Down
2 changes: 1 addition & 1 deletion designs/sam_build_cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ build actions. This section will look like:
"build": {
"actions": {
"java8": "gradle build",
"dotnetcore2.1": "./build.sh"
"dotnet6": "./build.sh"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 2.7, 3.2 using Bundler\n
4. Java 8, Java 11, Java 17 using Gradle and Maven\n
5. Dotnetcore 3.1, Dotnet6 using Dotnet CLI (without --use-container)\n
5. Dotnet6 using Dotnet CLI (without --use-container)\n
6. Go 1.x using Go Modules (without --use-container)\n
"""

Expand Down
8 changes: 4 additions & 4 deletions samcli/commands/init/init_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ def get_preprocessed_manifest(
"""
This method get the manifest cloned from the git repo and preprocessed it.
Below is the link to manifest:
https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest.json
https://github.com/aws/aws-sam-cli-app-templates/blob/master/manifest-v2.json
The structure of the manifest is shown below:
{
"dotnetcore3.1": [
"dotnet6": [
{
"directory": "dotnetcore3.1/cookiecutter-aws-sam-hello-dotnet",
"directory": "dotnet6/hello",
"displayName": "Hello World Example",
"dependencyManager": "cli-package",
"appTemplate": "hello-world",
"packageType": "Zip",
"useCaseName": "Serverless API"
"useCaseName": "Hello World Example"
},
]
}
Expand Down
1 change: 1 addition & 0 deletions samcli/lib/build/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"nodejs10.x",
"dotnetcore2.0",
"dotnetcore2.1",
"dotnetcore3.1",
"python2.7",
"python3.6",
"ruby2.5",
Expand Down
1 change: 0 additions & 1 deletion samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def get_workflow_config(
"nodejs18.x": BasicWorkflowSelector(NODEJS_NPM_CONFIG),
"ruby2.7": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
"ruby3.2": BasicWorkflowSelector(RUBY_BUNDLER_CONFIG),
"dotnetcore3.1": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"dotnet6": BasicWorkflowSelector(DOTNET_CLIPACKAGE_CONFIG),
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),
# When Maven builder exists, add to this list so we can automatically choose a builder based on the supported
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/init/local_manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dotnetcore3.1": [
"dotnet6": [
{
"directory": "template/cookiecutter-aws-sam-hello-dotnet",
"displayName": "Hello World Example",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"project_name": "Name of the project",
"runtime": "dotnetcore3.1",
"runtime": "dotnet6",
"architectures": {
"value": [
"x86_64"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
<TargetFramework>netcoreapp3.1</TargetFramework>
{%- else %}
<TargetFramework>net6.0</TargetFramework>
{%- endif %}
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"profile":"",
"region" : "",
"configuration": "Release",
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
"framework" : "netcoreapp3.1",
{%- endif %}
"function-runtime":"{{ cookiecutter.runtime }}",
"function-memory-size" : 256,
"function-timeout" : 30,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Resources:
Properties:
CodeUri: ./src/HelloWorld/
Handler: HelloWorld::HelloWorld.Function::FunctionHandler
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
Runtime: dotnetcore3.1
{%- if cookiecutter.runtime == 'dotnet6' %}
Runtime: dotnet6
{%- endif %}
Architectures:
{%- for arch in cookiecutter.architectures.value %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
{%- if cookiecutter.runtime == 'dotnetcore3.1' %}
<TargetFramework>netcoreapp3.1</TargetFramework>
{%- else %}
{%- if cookiecutter.runtime == 'dotnet6' %}
<TargetFramework>net6.0</TargetFramework>
{%- endif %}
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion samcli/lib/utils/architecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"java11": [ARM64, X86_64],
"java17": [ARM64, X86_64],
"go1.x": [X86_64],
"dotnetcore3.1": [ARM64, X86_64],
"dotnet6": [ARM64, X86_64],
"provided": [X86_64],
"provided.al2": [ARM64, X86_64],
Expand Down
8 changes: 3 additions & 5 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"dotnet": [
{
"runtimes": ["dotnet6", "dotnetcore3.1"],
"runtimes": ["dotnet6"],
"dependency_manager": "cli-package",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-dotnet"),
"build": True,
Expand Down Expand Up @@ -96,9 +96,8 @@ def get_local_lambda_images_location(mapping, runtime):
# When adding new Lambda runtimes, please update SAM_RUNTIME_TO_SCHEMAS_CODE_LANG_MAPPING
# Runtimes are ordered in alphabetical fashion with reverse version order (latest versions first)
INIT_RUNTIMES = [
# dotnetcore runtimes in descending order
# dotnet runtimes in descending order
"dotnet6",
"dotnetcore3.1",
"go1.x",
# java runtimes in descending order
"java17",
Expand Down Expand Up @@ -126,7 +125,6 @@ def get_local_lambda_images_location(mapping, runtime):

LAMBDA_IMAGES_RUNTIMES_MAP = {
"dotnet6": "amazon/dotnet6-base",
"dotnetcore3.1": "amazon/dotnetcore3.1-base",
"go1.x": "amazon/go1.x-base",
"go (provided.al2)": "amazon/go-provided.al2-base",
"java17": "amazon/java17-base",
Expand Down Expand Up @@ -158,7 +156,7 @@ def get_local_lambda_images_location(mapping, runtime):
"python3.8": "Python36",
"python3.9": "Python36",
"python3.10": "Python36",
"dotnet6": "dotnetcore3.1",
"dotnet6": "dotnet6",
"go1.x": "Go1",
}

Expand Down
4 changes: 0 additions & 4 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
**_container_env_vars,
},
),
Runtime.dotnetcore31.value: lambda: DebugSettings(
entry + ["/var/runtime/bootstrap"] + debug_args_list,
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},
),
Runtime.dotnet6.value: lambda: DebugSettings(
entry + ["/var/runtime/bootstrap"] + debug_args_list,
container_env_vars={"_AWS_LAMBDA_DOTNET_DEBUGGING": "1", **_container_env_vars},
Expand Down
3 changes: 1 addition & 2 deletions samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Runtime(Enum):
java11 = "java11"
java17 = "java17"
go1x = "go1.x"
dotnetcore31 = "dotnetcore3.1"
dotnet6 = "dotnet6"
provided = "provided"
providedal2 = "provided.al2"
Expand Down Expand Up @@ -86,7 +85,7 @@ def get_image_name_tag(cls, runtime: str, architecture: str) -> str:
# `provided.al2` becomes `provided:al2``
runtime_image_tag = runtime.replace(".", ":")
elif runtime.startswith("dotnet"):
# dotnetcore3.1 becomes dotnet:core3.1 and dotnet6 becomes dotnet:6
# dotnet6 becomes dotnet:6
runtime_image_tag = runtime.replace("dotnet", "dotnet:")
else:
# This fits most runtimes format: `nameN.M` becomes `name:N.M` (python3.9 -> python:3.9)
Expand Down
35 changes: 4 additions & 31 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,15 +1223,13 @@ class TestBuildCommand_Dotnet_cli_package(BuildIntegBase):

@parameterized.expand(
[
("dotnetcore3.1", "Dotnetcore3.1", None),
("dotnet6", "Dotnet6", None),
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
("dotnet6", "Dotnet6", "debug"),
("provided.al2", "Dotnet7", None),
]
)
@pytest.mark.flaky(reruns=3)
def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_64"):
def test_dotnet_in_process(self, runtime, code_uri, mode, architecture="x86_64"):
# dotnet7 requires docker to build the function
if code_uri == "Dotnet7" and (SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD):
self.skipTest(SKIP_DOCKER_MESSAGE)
Expand Down Expand Up @@ -1294,9 +1292,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_

@parameterized.expand(
[
("dotnetcore3.1", "Dotnetcore3.1", None),
("dotnet6", "Dotnet6", None),
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
("dotnet6", "Dotnet6", "debug"),
# force to run tests on arm64 machines may cause dotnet7 test failing
# because Native AOT Lambda functions require the host and lambda architectures to match
Expand All @@ -1305,7 +1301,7 @@ def test_dotnetcore_in_process(self, runtime, code_uri, mode, architecture="x86_
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
@pytest.mark.flaky(reruns=3)
def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"):
def test_dotnet_in_container_mount_with_write_explicit(self, runtime, code_uri, mode, architecture="x86_64"):
overrides = {
"Runtime": runtime,
"CodeUri": code_uri,
Expand Down Expand Up @@ -1368,9 +1364,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u

@parameterized.expand(
[
("dotnetcore3.1", "Dotnetcore3.1", None),
("dotnet6", "Dotnet6", None),
("dotnetcore3.1", "Dotnetcore3.1", "debug"),
("dotnet6", "Dotnet6", "debug"),
# force to run tests on arm64 machines may cause dotnet7 test failing
# because Native AOT Lambda functions require the host and lambda architectures to match
Expand All @@ -1379,7 +1373,7 @@ def test_dotnetcore_in_container_mount_with_write_explicit(self, runtime, code_u
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
@pytest.mark.flaky(reruns=3)
def test_dotnetcore_in_container_mount_with_write_interactive(
def test_dotnet_in_container_mount_with_write_interactive(
self,
runtime,
code_uri,
Expand Down Expand Up @@ -1444,7 +1438,7 @@ def test_dotnetcore_in_container_mount_with_write_interactive(
)
self.verify_docker_container_cleanedup(runtime)

@parameterized.expand([("dotnetcore3.1", "Dotnetcore3.1"), ("dotnet6", "Dotnet6")])
@parameterized.expand([("dotnet6", "Dotnet6")])
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
@pytest.mark.flaky(reruns=3)
def test_must_fail_on_container_mount_without_write_interactive(self, runtime, code_uri):
Expand Down Expand Up @@ -2045,13 +2039,6 @@ class TestBuildWithDedupBuilds(DedupBuildIntegBase):
@parameterized.expand(
[
# in process
(
False,
"Dotnetcore3.1",
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
"dotnetcore3.1",
),
(
False,
"Dotnet6",
Expand Down Expand Up @@ -2177,13 +2164,6 @@ class TestBuildWithCacheBuilds(CachedBuildIntegBase):
@parameterized.expand(
[
# in process
(
False,
"Dotnetcore3.1",
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
"dotnetcore3.1",
),
(
False,
"Dotnet6",
Expand Down Expand Up @@ -2366,13 +2346,6 @@ class TestParallelBuilds(DedupBuildIntegBase):
@parameterized.expand(
[
# in process
(
False,
"Dotnetcore3.1",
"HelloWorld::HelloWorld.FirstFunction::FunctionHandler",
"HelloWorld::HelloWorld.SecondFunction::FunctionHandler",
"dotnetcore3.1",
),
(
False,
"Dotnet6",
Expand Down

This file was deleted.

44 changes: 0 additions & 44 deletions tests/integration/testdata/buildcmd/Dotnetcore3.1/Program.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit cfacdf5

Please sign in to comment.