Skip to content

Include RIC pr target in GitHub action #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/maven-build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ jobs:
run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
- name: Build log4j2 with Maven
run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
- name: Build serialization with Maven
run: mvn -B package --file aws-lambda-java-serialization/pom.xml
- name: Build runtime-interface-client with Maven
run: mvn -B package --file aws-lambda-java-runtime-interface-client/pom.xml

# Test Runtime Interface Client
- name: Run 'pr' target
working-directory: ./aws-lambda-java-runtime-interface-client
run: make pr
Comment on lines +35 to +38
Copy link
Contributor

@carlzogh carlzogh Dec 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this actually takes a while - I suggest we create a separate workflow that would only trigger if changes were made for the RIC (aws-lambda-java-runtime-interface-client).

ref. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#example-including-paths

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could even take the opportunity to define a workflow per package as there is probably no need to build them all on every change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a follow up PR for restructuring the workflow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

2 changes: 1 addition & 1 deletion aws-lambda-java-runtime-interface-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Choose a preferred base image. The Runtime Interface Client is tested on Amazon

* built for x86_64
* contains Java >= 8
* contains glibc >= 2.12 or musl
* contains glibc >= 2.17 or musl

### Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# we use centos 6 to build against glibc 2.12
FROM centos:6
# we use centos 7 to build against glibc 2.17
FROM centos:7

# aws-lambda-cpp requires cmake3, it's available in EPEL
RUN yum install -y epel-release
RUN yum install -y \
cmake3 \
make \
gcc \
gcc-c++ \
glibc-devel \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,37 @@ private List<String> strip(String base, URL[] urls) {
@Test
@DisabledOnOs(MAC) // test fails on systems with case-insensitive volumes
public void customerClassLoaderFunction() throws IOException {
Path rootDir = fakeFileSystem(EXAMPLE_FUNCTION);

URLClassLoader customerClassLoader = new CustomerClassLoader(
rootDir.resolve("user/path").toString(),
rootDir.resolve("opt/java").toString(),
ClassLoader.getSystemClassLoader());

List<String> res = strip("file:" + rootDir.toString(), customerClassLoader.getURLs());

Assertions.assertEquals(Arrays.asList(
"/user/path/",
"/user/path/lib/4.jar",
"/user/path/lib/A.jar",
"/user/path/lib/a.jar",
"/user/path/lib/b.jar",
"/user/path/lib/z.jar",
"/user/path/lib/λ.jar"),
res);
try {
Path rootDir = fakeFileSystem(EXAMPLE_FUNCTION);

URLClassLoader customerClassLoader = new CustomerClassLoader(
rootDir.resolve("user/path").toString(),
rootDir.resolve("opt/java").toString(),
ClassLoader.getSystemClassLoader());

List<String> res = strip("file:" + rootDir.toString(), customerClassLoader.getURLs());

Assertions.assertEquals(Arrays.asList(
"/user/path/",
"/user/path/lib/4.jar",
"/user/path/lib/A.jar",
"/user/path/lib/a.jar",
"/user/path/lib/b.jar",
"/user/path/lib/z.jar",
"/user/path/lib/λ.jar"),
res);
} catch(Throwable t) {
// this system property is the name of the charset used when encoding/decoding file paths
// exception is expected if it is not set to a UTF variant or not set at all
String systemEncoding = System.getProperty("sun.jnu.encoding");

if (systemEncoding != null && !systemEncoding.toLowerCase().contains("utf")){
Assertions.assertTrue(t.getMessage().contains("Malformed input or input contains unmappable characters"));
}
else {
throw t;
}
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ then
exit 1
fi

docker_command="docker run -it "
docker_command="docker run "
if isOSWindows
then
docker_command+="-v //var/run/docker.sock:/var/run/docker.sock -e "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ batch:
env:
variables:
DISTRO_VERSION:
- "6"
- "7"
- "8"
RUNTIME_VERSION:
Expand Down