Skip to content

Commit

Permalink
Revert "feat: Add java21 runtime support (aws#553)" (aws#558)
Browse files Browse the repository at this point in the history
This reverts commit 10f670e.
  • Loading branch information
hawflau authored Oct 17, 2023
1 parent 10f670e commit b5b3682
Show file tree
Hide file tree
Showing 27 changed files with 77 additions and 635 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '21'
java-version: '17'
# Install and configure Rust & Cargo Lambda
- name: Install and configure Rust & Cargo Lambda
if: ${{ matrix.os == 'ubuntu-latest' }}
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 @@ -55,7 +55,7 @@
1. Python 3.7, 3.8, 3.9, 3.10, 3.11 using PIP\n
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, Java 21 using Gradle and Maven\n
4. Java 8, Java 11, Java 17 using Gradle and Maven\n
5. Dotnet6 using Dotnet CLI (without --use-container)\n
6. Go 1.x using Go Modules (without --use-container)\n
"""
Expand Down
9 changes: 0 additions & 9 deletions samcli/lib/build/workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def get_layer_subfolder(build_workflow: str) -> str:
"java11": "java",
"java8.al2": "java",
"java17": "java",
"java21": "java",
"dotnet6": "dotnet",
# User is responsible for creating subfolder in these workflows
"makefile": "",
Expand Down Expand Up @@ -200,14 +199,6 @@ def get_workflow_config(
JAVA_MAVEN_CONFIG,
]
),
"java21": ManifestWorkflowSelector(
[
# Gradle builder needs custom executable paths to find `gradlew` binary
JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
JAVA_MAVEN_CONFIG,
]
),
"provided": BasicWorkflowSelector(PROVIDED_MAKE_CONFIG),
"provided.al2": BasicWorkflowSelector(PROVIDED_MAKE_CONFIG),
}
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 @@
"java8.al2": [ARM64, X86_64],
"java11": [ARM64, X86_64],
"java17": [ARM64, X86_64],
"java21": [ARM64, X86_64],
"go1.x": [X86_64],
"dotnet6": [ARM64, X86_64],
"provided": [X86_64],
Expand Down
2 changes: 1 addition & 1 deletion samcli/lib/utils/preview_runtimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"""
from typing import Set

PREVIEW_RUNTIMES: Set[str] = {"java21"}
PREVIEW_RUNTIMES: Set[str] = set()
7 changes: 2 additions & 5 deletions samcli/local/common/runtime_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
],
"java": [
{
"runtimes": ["java11", "java8", "java8.al2", "java17", "java21"],
"runtimes": ["java11", "java8", "java8.al2", "java17"],
"dependency_manager": "maven",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-java-maven"),
"build": True,
},
{
"runtimes": ["java11", "java8", "java8.al2", "java17", "java21"],
"runtimes": ["java11", "java8", "java8.al2", "java17"],
"dependency_manager": "gradle",
"init_location": os.path.join(_templates, "cookiecutter-aws-sam-hello-java-gradle"),
"build": True,
Expand Down Expand Up @@ -102,7 +102,6 @@ def get_local_lambda_images_location(mapping, runtime):
"dotnet6",
"go1.x",
# java runtimes in descending order
"java21",
"java17",
"java11",
"java8.al2",
Expand Down Expand Up @@ -131,7 +130,6 @@ def get_local_lambda_images_location(mapping, runtime):
"dotnet6": "amazon/dotnet6-base",
"go1.x": "amazon/go1.x-base",
"go (provided.al2)": "amazon/go-provided.al2-base",
"java21": "amazon/java21-base",
"java17": "amazon/java17-base",
"java11": "amazon/java11-base",
"java8.al2": "amazon/java8.al2-base",
Expand All @@ -158,7 +156,6 @@ def get_local_lambda_images_location(mapping, runtime):
"java8.al2": "Java8",
"java11": "Java8",
"java17": "Java17",
"java21": "Java21",
"python3.7": "Python36",
"python3.8": "Python36",
"python3.9": "Python36",
Expand Down
10 changes: 0 additions & 10 deletions samcli/local/docker/lambda_debug_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ def get_debug_settings(debug_port, debug_args_list, _container_env_vars, runtime
**_container_env_vars,
},
),
Runtime.java21.value: lambda: DebugSettings(
entry,
container_env_vars={
"_JAVA_OPTIONS": "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,"
f"address=*:{debug_port} -XX:MaxHeapSize=2834432k -XX:+UseSerialGC "
"-XX:+TieredCompilation -XX:TieredStopAtLevel=1 "
"-Djava.net.preferIPv4Stack=true" + " ".join(debug_args_list),
**_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
1 change: 0 additions & 1 deletion samcli/local/docker/lambda_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Runtime(Enum):
java8al2 = "java8.al2"
java11 = "java11"
java17 = "java17"
java21 = "java21"
go1x = "go1.x"
dotnet6 = "dotnet6"
provided = "provided"
Expand Down
102 changes: 35 additions & 67 deletions tests/integration/buildcmd/test_build_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,16 +882,6 @@ class TestBuildCommand_Java(BuildIntegJavaBase):
EXPECTED_GRADLE_DEPENDENCIES,
),
("java17", "17", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java21", "21", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java21", "21", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java21",
"21",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java21", "21", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
]
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
Expand All @@ -909,72 +899,50 @@ def test_building_java_in_container(

@parameterized.expand(
[
("java8", "8", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8", "8", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java8",
"8",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java8", "8", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java8.al2", "8", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8", USING_GRADLE_KOTLIN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java8.al2", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java8.al2", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java8.al2",
"8",
USING_GRADLEW_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
(
"java8.al2",
"8",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java8.al2", "8", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java11", "11", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java11", "11", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java11",
"11",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java11", "11", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java17", "17", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java17", "17", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java17",
"17",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java17", "17", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java21", "21", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java21", "21", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
(
"java21",
"21",
USING_GRADLE_KOTLIN_PATH,
EXPECTED_FILES_PROJECT_MANIFEST_GRADLE,
EXPECTED_GRADLE_DEPENDENCIES,
),
("java21", "21", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
("java8.al2", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
]
)
def test_building_java_in_process(self, runtime, runtime_version, code_path, expected_files, expected_dependencies):
def test_building_java8_in_process(self, runtime, code_path, expected_files, expected_dependencies):
self._test_with_building_java(
runtime,
os.path.join(code_path, runtime_version),
expected_files,
expected_dependencies,
False,
self.test_data_path,
runtime, os.path.join(code_path, "8"), expected_files, expected_dependencies, False, self.test_data_path
)

@parameterized.expand(
[
("java11", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java11", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java11", USING_GRADLE_KOTLIN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java11", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
]
)
def test_building_java11_in_process(self, runtime, code_path, expected_files, expected_dependencies):
self._test_with_building_java(
runtime, os.path.join(code_path, "11"), expected_files, expected_dependencies, False, self.test_data_path
)

@parameterized.expand(
[
("java17", USING_GRADLE_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java17", USING_GRADLEW_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java17", USING_GRADLE_KOTLIN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_GRADLE, EXPECTED_GRADLE_DEPENDENCIES),
("java17", USING_MAVEN_PATH, EXPECTED_FILES_PROJECT_MANIFEST_MAVEN, EXPECTED_MAVEN_DEPENDENCIES),
]
)
def test_building_java17_in_process(self, runtime, code_path, expected_files, expected_dependencies):
self._test_with_building_java(
runtime, os.path.join(code_path, "17"), expected_files, expected_dependencies, False, self.test_data_path
)


Expand Down
Loading

0 comments on commit b5b3682

Please sign in to comment.