Skip to content

Commit

Permalink
Thorntail -> Quarkus
Browse files Browse the repository at this point in the history
  • Loading branch information
Karm committed Apr 12, 2022
1 parent 0df9b50 commit 66e3e1f
Show file tree
Hide file tree
Showing 158 changed files with 1,951 additions and 1,493 deletions.
29 changes: 15 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,38 @@ jobs:
curl -X POST -i -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $GITTER_TOKEN" \
"https://api.gitter.im/v1/rooms/$GITTER_ROOM_ID/chatMessages" -d \
"{\"text\":\"Automatic message: Hello, new [build]($CIRCLE_BUILD_URL) has started.\"}"
- run: if [[ ! -d ${HOME}/jdk-11.0.9+11 ]];then wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.9%2B11/OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz;fi;
- run: if [[ ! -d ${HOME}/jdk-11.0.9+11 ]];then tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.9_11.tar.gz -C ${HOME}/;fi;
- run: if [[ ! -d ${HOME}/jdk-11.0.14.1+1 ]];then wget https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14.1%2B1/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz;fi;
- run: if [[ ! -d ${HOME}/jdk-11.0.14.1+1 ]];then tar -xvf OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz -C ${HOME}/;fi;
# Don't forget that various severs need maven for testing, e.g. Tomee etc.
- run: if [[ ! -d ${HOME}/apache-maven-3.6.3 ]];then wget https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz;fi;
- run: if [[ ! -d ${HOME}/apache-maven-3.6.3 ]];then tar -xvf apache-maven-3.6.3-bin.tar.gz -C ${HOME}/;fi;
- run:
name: build-fetch
command: |
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.9+11/bin:${PATH}; \
export JAVA_HOME=${HOME}/jdk-11.0.9+11/; \
mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 dependency:go-offline -Pthorntail -Dskip.integration.tests=false
export JAVA_HOME=${HOME}/jdk-11.0.14.1+1/; \
mkdir -p ~/.m2/; \
cp ./Container/settings.xml ~/.m2/settings.xml; \
./mvnw dependency:go-offline
- save_cache:
paths:
- ${HOME}/.m2
- ${HOME}/apache-maven-3.6.3
- ${HOME}/jdk-11.0.9+11
- ${HOME}/jdk-11.0.14.1+1
key: v1-dependencies-{{ checksum "pom.xml" }}
- run:
name: package-tests
no_output_timeout: 120000
command: |
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.9+11/bin:${PATH}; \
export JAVA_HOME=${HOME}/jdk-11.0.9+11/; \
export PATH=${HOME}/apache-maven-3.6.3/bin:${HOME}/jdk-11.0.14.1+1/bin:${PATH}; \
export JAVA_HOME=${HOME}/jdk-11.0.14.1+1/; \
export WLP_JAR_EXTRACT_DIR=${HOME}; \
mvn -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 clean package -Pthorntail \
./mvnw clean package \
'-Dtest=#w*' '-Dtest=#q*' '-Dtest=#t*' '-Dtest=#k*' '-Dtest=#h*' '-Dtest=#p*' \
-Dskip.integration.tests=false -DSTARTER_TS_WORKSPACE=/dev/shm/
-DSTARTER_TS_WORKSPACE=/dev/shm/
- persist_to_workspace:
root: .
paths:
- ./target/mp-starter-hollow-thorntail.jar
- ./target/mp-starter.war
- ./target/quarkus-app
- ./Container

docker-build:
Expand All @@ -64,11 +65,11 @@ jobs:
- run:
name: Prepare files for Docker build
command: |
cp /tmp/workspace/Container . -R && cp /tmp/workspace/target . -R && unzip target/mp-starter-hollow-thorntail.jar -d target/mp-starter-hollow-thorntail
cp /tmp/workspace/Container . -R && cp /tmp/workspace/target . -R
- run:
name: Build Docker image
command: |
docker build -f Container/Dockerfile -t $IMAGE_NAME:master .
docker build -f ./Container/Dockerfile.jvm -t $IMAGE_NAME:master .
- run:
name: Archive built Docker image
command: docker save -o image.tar $IMAGE_NAME
Expand Down
75 changes: 51 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ env:

jobs:
run-units:
name: API MicroProfile Starter
runs-on: ubuntu-20.04
name: API and WEB smoke test - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, windows-2019 ]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -61,23 +65,32 @@ jobs:
with:
maven-version: 3.6.3
- name: Build and run tests for Starter
if: startsWith(matrix.os, 'windows')
run: |
cmd /C mvn --version
cmd /C mvnw.cmd --version
cmd /C java --version
copy Container\settings.xml ~\.m2\settings.xml
cmd /C mvnw.cmd clean verify -Dtest=APIITCase -DSTARTER_TS_WORKSPACE=%RUNNER_TEMP%
shell: cmd
- name: Build and run tests for Starter
if: startsWith(matrix.os, 'ubuntu')
run: |
mvn --version
./mvnw --version
java --version
mvn clean verify -Pthorntail -Dtest=APITest -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-apitest.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v2
if: failure()
mkdir -p ~/.m2/
cp ./Container/settings.xml ~/.m2/settings.xml
./mvnw clean verify -Dtest=APIITCase -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports-apitest
path: 'test-reports-apitest.tgz'
name: test-reports-apitest-${{ matrix.os }}
path: |
target/surefire-reports
run-starter:
name: ${{ matrix.runtime }} MicroProfile Starter
runs-on: ubuntu-20.04
name: ${{ matrix.runtime }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
Expand All @@ -89,6 +102,7 @@ jobs:
'thorntail',
'tomee',
'wildfly' ]
os: [ ubuntu-20.04, windows-2019 ]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -117,17 +131,30 @@ jobs:
with:
maven-version: 3.6.3
- name: Build and run tests for Starter
if: startsWith(matrix.os, 'windows')
# We run only a subset of tests on Windows, the "All" (all examples selected variant)
# Due to notorious instabilities in file locking in ~/.m2 on GitHub Actions runners.
# It might take some of the server's processes to release those locks.
run: |
cmd /C mvn --version
cmd /C mvnw.cmd --version
cmd /C java --version
copy Container\settings.xml ~\.m2\settings.xml
cmd /C mvnw.cmd clean verify -Dtest=TestMatrixITCase#${{ matrix.runtime }}All -DSTARTER_TS_WORKSPACE=%RUNNER_TEMP%
shell: cmd
- name: Build and run tests for Starter
if: startsWith(matrix.os, 'ubuntu')
run: |
mvn --version
./mvnw --version
java --version
mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-${{ matrix.runtime }}.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v2
if: failure()
mkdir -p ~/.m2/
cp ./Container/settings.xml ~/.m2/settings.xml
./mvnw clean verify -Dtest=TestMatrixITCase#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports-${{ matrix.runtime }}
path: 'test-reports-${{ matrix.runtime }}.tgz'
name: test-reports-${{ matrix.runtime }}-${{ matrix.os }}
path: |
target/surefire-reports
target/archived-logs
142 changes: 142 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader
{
private static final String WRAPPER_VERSION = "3.1.0";

/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
"https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/" + WRAPPER_VERSION
+ "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to use instead of the
* default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main( String args[] )
{
System.out.println( "- Downloader started" );
File baseDirectory = new File( args[0] );
System.out.println( "- Using base directory: " + baseDirectory.getAbsolutePath() );

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File( baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH );
String url = DEFAULT_DOWNLOAD_URL;
if ( mavenWrapperPropertyFile.exists() )
{
FileInputStream mavenWrapperPropertyFileInputStream = null;
try
{
mavenWrapperPropertyFileInputStream = new FileInputStream( mavenWrapperPropertyFile );
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load( mavenWrapperPropertyFileInputStream );
url = mavenWrapperProperties.getProperty( PROPERTY_NAME_WRAPPER_URL, url );
}
catch ( IOException e )
{
System.out.println( "- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'" );
}
finally
{
try
{
if ( mavenWrapperPropertyFileInputStream != null )
{
mavenWrapperPropertyFileInputStream.close();
}
}
catch ( IOException e )
{
// Ignore ...
}
}
}
System.out.println( "- Downloading from: " + url );

File outputFile = new File( baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH );
if ( !outputFile.getParentFile().exists() )
{
if ( !outputFile.getParentFile().mkdirs() )
{
System.out.println( "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath()
+ "'" );
}
}
System.out.println( "- Downloading to: " + outputFile.getAbsolutePath() );
try
{
downloadFileFromURL( url, outputFile );
System.out.println( "Done" );
System.exit( 0 );
}
catch ( Throwable e )
{
System.out.println( "- Error downloading" );
e.printStackTrace();
System.exit( 1 );
}
}

private static void downloadFileFromURL( String urlString, File destination )
throws Exception
{
if ( System.getenv( "MVNW_USERNAME" ) != null && System.getenv( "MVNW_PASSWORD" ) != null )
{
String username = System.getenv( "MVNW_USERNAME" );
char[] password = System.getenv( "MVNW_PASSWORD" ).toCharArray();
Authenticator.setDefault( new Authenticator()
{
@Override
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( username, password );
}
} );
}
URL website = new URL( urlString );
ReadableByteChannel rbc;
rbc = Channels.newChannel( website.openStream() );
FileOutputStream fos = new FileOutputStream( destination );
fos.getChannel().transferFrom( rbc, 0, Long.MAX_VALUE );
fos.close();
rbc.close();
}

}
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
11 changes: 0 additions & 11 deletions Container/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions Container/Dockerfile.CI

This file was deleted.

11 changes: 11 additions & 0 deletions Container/Dockerfile.jvm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM registry.access.redhat.com/ubi8/openjdk-11:1.11
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 target/quarkus-app/*.jar /deployments/
COPY --chown=185 target/quarkus-app/app/ /deployments/app/
COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/
EXPOSE 8080
USER 185
ENV AB_JOLOKIA_OFF=""
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
Loading

0 comments on commit 66e3e1f

Please sign in to comment.