Skip to content
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

Testsuite - Fix in dotnet - Forms 1rst test #65

Merged
merged 9 commits into from
Dec 1, 2023
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
48 changes: 47 additions & 1 deletion basis/bin/shared_bash_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,50 @@ configure() {
esac
fi
fi
}
}

java_get_version() {
JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
JAVA_VERSION_NUMBER=$(echo $JAVA_VERSION | awk -F '.' '{print $1}')
}

java_home_exists() {
if [ -d /$1 ]; then
export JAVA_HOME=$1
export PATH=$JAVA_HOME/bin:$PATH
java -version
return 0
fi
echo "Not Found $1"
return 1
}

java_check_exact_version() {
java_get_version
if [[ "$1" = "$JAVA_VERSION_NUMBER" ]]; then
echo "Check Java Version OK: Request: $1 = Found: $JAVA_VERSION_NUMBER"
else
echo "Check Java Version FAILED: Request: $1 != Found $JAVA_VERSION_NUMBER"
exit 1
fi
}

java_find_version() {
JAVA_REQUEST=$1
java_get_version
if [[ "$JAVA_VERSION_NUMBER" < "$JAVA_REQUEST" ]]; then
echo "Java Version too small: Found $JAVA_VERSION_NUMBER < Request: $JAVA_REQUEST"
echo "Trying to find version $1 in standard Java directory"
if java_home_exists /usr/lib64/graalvm/graalvm-java$JAVA_REQUEST; then
return;
fi;
if java_home_exists /usr/java/jdk-$JAVA_REQUEST; then
return;
fi;
echo "Not found"
exit 1
else
echo "Check Java Version OK: Request: $JAVA_REQUEST <= Found: $JAVA_VERSION_NUMBER"
fi
}

4 changes: 3 additions & 1 deletion option/compute/compute_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ install_java() {
elif [ "$TF_VAR_java_version" == 17 ]; then
sudo dnf install -y graalvm22-ee-17-jdk
sudo update-alternatives --set java /usr/lib64/graalvm/graalvm22-ee-java17/bin/java
# sudo update-alternatives --set native-image /usr/lib64/graalvm/graalvm22-ee-java17/lib/svm/bin/native-image
elif [ "$TF_VAR_java_version" == 21 ]; then
sudo dnf install -y graalvm-21-jdk
sudo update-alternatives --set java /usr/lib64/graalvm/graalvm22-ee-java21/bin/java
sudo update-alternatives --set java /usr/lib64/graalvm/graalvm-java21/bin/java
# sudo update-alternatives --set native-image /usr/lib64/graalvm/graalvm-java21/lib/svm/bin/native-image
fi
else
# jdk
Expand Down
1 change: 1 addition & 0 deletions option/compute/nginx_app.locations
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

location /app/ {
proxy_http_version 1.1;
proxy_pass http://localhost:8080/;
}

2 changes: 1 addition & 1 deletion option/src/app/dotnet/src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ cd $SCRIPT_DIR
# Install Dotnet
wget https://dot.net/v1/dotnet-install.sh
sudo chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest
./dotnet-install.sh --channel 6.0 --version latest
ls $HOME/.dotnet
4 changes: 4 additions & 0 deletions option/src/app/forms/.autosetup.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SCHEMA_DB=local_db
DB_ALIAS=orcl
JDBC_STR=jdbc:oracle:thin:@forms1:1521:orcl
SCHEMA_PREFIX=FRM
1 change: 1 addition & 0 deletions option/src/app/forms/.autosetup.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"db_passwd": "Weblo123", "wls_passwd": "Weblo123", "vnc_passwd": "Weblo123", "schema_passwd": "Weblo123"}
Empty file added option/src/app/forms/.success
Empty file.
14 changes: 14 additions & 0 deletions option/src/app/forms/domainconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# touch /u01/oracle/.frm_config/msg/.in_progress
cd /u01/oracle/.frm_config/scripts
# nohup /u01/oracle/middleware/Oracle_Home/oracle_common/common/bin/wlst.sh /u01/oracle/.frm_config/scripts/wlst/domainconfig.py > /tmp/provision.log 2>&1 &

cd /u01/oracle/.frm_config/scripts
sed -i.bak utils.sh -e "s/clean_up_exit[ ]*$/# clean_up_exit/g"
sed -i.bak provision.sh -e "s/clean_up_exit[ ]*$/# clean_up_exit/g"
cd wlst
sed -i.bak domainconfig.py -e "s/delete_file_if_exists/# delete_file_if_exists/g"

# Start the bootstrap
# It works only if .autosetup.ini and json exist
sudo /u01/oracle/.frm_config/bootstrap.sh
5 changes: 3 additions & 2 deletions option/src/app/java_helidon/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ if [ "$TF_VAR_java_vm" == "graalvm-native" ]; then
fi

if [ "$TF_VAR_deploy_strategy" == "compute" ]; then
# -Dnet.bytebuddy.experimental=true is needed in helidon 3 for Java 21
if [ "$TF_VAR_java_vm" == "graalvm-native" ]; then
mvn package -Pnative-image -Dnative.image.buildStatic -DskipTests
mvn package -Pnative-image -Dnative.image.buildStatic -DskipTests -Dnet.bytebuddy.experimental=true
else
mvn package -DskipTests
mvn package -DskipTests -Dnet.bytebuddy.experimental=true
fi
exit_on_error
cp start.sh install.sh target/.
Expand Down
1 change: 1 addition & 0 deletions option/src/app/java_helidon4/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/*
1 change: 1 addition & 0 deletions option/src/app/java_helidon4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/main/resources/META-INF/microprofile-config.properties
6 changes: 6 additions & 0 deletions option/src/app/java_helidon4/.helidon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Helidon Project Configuration
#Tue Nov 28 15:47:31 UTC 2023
schema.version=1.1.0
helidon.version=4.0.0
project.flavor=mp
project.archetype=database
39 changes: 39 additions & 0 deletions option/src/app/java_helidon4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# 1st stage, build the app
FROM container-registry.oracle.com/java/openjdk:21 as build

# Install maven
WORKDIR /usr/share
RUN set -x && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
rm apache-maven-*-bin.tar.gz && \
mv apache-maven-* maven && \
ln -s /usr/share/maven/bin/mvn /bin/

WORKDIR /helidon

# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update
# the pom
ADD pom.xml pom.xml
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip -Declipselink.weave.skip -DskipOpenApiGenerate

# Do the Maven build!
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn package -DskipTests

RUN echo "done!"

# 2nd stage, build the runtime image
FROM container-registry.oracle.com/java/openjdk:21
WORKDIR /helidon

# Copy the binary built in the 1st stage
COPY --from=build /helidon/target/helidon.jar ./
COPY --from=build /helidon/target/libs ./libs

CMD ["java", "-jar", "helidon.jar"]

EXPOSE 8080
25 changes: 25 additions & 0 deletions option/src/app/java_helidon4/Dockerfile.jlink
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# 1st stage, build the app
FROM maven:3.8.4-openjdk-17-slim as build

WORKDIR /helidon

# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update
# the pom
ADD pom.xml .
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip

# Do the Maven build to create the custom Java Runtime Image
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn package -Pjlink-image -DskipTests
RUN echo "done!"

# 2nd stage, build the final image with the JRI built in the 1st stage

FROM debian:stretch-slim
WORKDIR /helidon
COPY --from=build /helidon/target/helidon-jri ./
ENTRYPOINT ["/bin/bash", "/helidon/bin/start"]
EXPOSE 8080
39 changes: 39 additions & 0 deletions option/src/app/java_helidon4/Dockerfile.native
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# 1st stage, build the app
FROM ghcr.io/graalvm/graalvm-community:21.0.0-ol9 as build

WORKDIR /usr/share

# Install maven
RUN set -x && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \
tar -xvf apache-maven-*-bin.tar.gz && \
rm apache-maven-*-bin.tar.gz && \
mv apache-maven-* maven && \
ln -s /usr/share/maven/bin/mvn /bin/

WORKDIR /helidon

# Create a first layer to cache the "Maven World" in the local repository.
# Incremental docker builds will always resume after that, unless you update
# the pom
ADD pom.xml .
RUN mvn package -Pnative-image -Dnative.image.skip -Dmaven.test.skip -Declipselink.weave.skip

# Do the Maven build!
# Incremental docker builds will resume here when you change sources
ADD src src
RUN mvn package -Pnative-image -Dnative.image.buildStatic -DskipTests

RUN echo "done!"

# 2nd stage, build the runtime image
FROM scratch
WORKDIR /helidon

# Copy the binary built in the 1st stage
COPY --from=build /helidon/target/helidon .

ENTRYPOINT ["./helidon"]

EXPOSE 8080
Loading