Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b05e8f8
Create wrapper for Java lite SDK
timtay-microsoft Jun 7, 2023
35383fd
template
timtay-microsoft Jun 7, 2023
2a2455a
fixup
timtay-microsoft Jun 8, 2023
f7d5ff9
Update horton_build.py
timtay-microsoft Jun 8, 2023
e0f3820
Update generate.sh
timtay-microsoft Jun 8, 2023
e2e5e11
is this working?
timtay-microsoft Jun 8, 2023
7fdb167
Revert "is this working?"
timtay-microsoft Jun 8, 2023
30092dd
hardcode sha?
timtay-microsoft Jun 8, 2023
f24df8d
asdf
timtay-microsoft Jun 8, 2023
973c1e3
directories
timtay-microsoft Jun 8, 2023
c0cae83
?
timtay-microsoft Jun 8, 2023
e21874c
Update Dockerfile
timtay-microsoft Jun 8, 2023
4ac5f72
simplify
timtay-microsoft Jun 8, 2023
9c822a7
ls
timtay-microsoft Jun 8, 2023
75122e3
chmod
timtay-microsoft Jun 8, 2023
489b94f
oops
timtay-microsoft Jun 8, 2023
a746296
asdf
timtay-microsoft Jun 8, 2023
88cca6f
hardcode repo?
timtay-microsoft Jun 8, 2023
7710341
wrong
timtay-microsoft Jun 8, 2023
c107232
Update Dockerfile
timtay-microsoft Jun 8, 2023
56047c1
Update docker_tags.py
timtay-microsoft Jun 8, 2023
fd99f37
back to basics
timtay-microsoft Jun 8, 2023
3793b3d
fixup
timtay-microsoft Jun 8, 2023
3aaa4d9
to revert
timtay-microsoft Jun 8, 2023
4fa5354
Revert "to revert"
timtay-microsoft Jun 8, 2023
7519ca0
this was missing
timtay-microsoft Jun 8, 2023
f05f2c0
hardcode commit for test purposes
timtay-microsoft Jun 8, 2023
49a9c83
????
timtay-microsoft Jun 8, 2023
6b4b7d5
chmod
timtay-microsoft Jun 8, 2023
d765b38
asdf
timtay-microsoft Jun 8, 2023
ae5c27f
asdf
timtay-microsoft Jun 8, 2023
a2c5486
????
timtay-microsoft Jun 8, 2023
52c6cfa
adsf
timtay-microsoft Jun 8, 2023
9c5ee24
asdf
timtay-microsoft Jun 8, 2023
c03d8f4
asdf
timtay-microsoft Jun 8, 2023
dfed7c8
maybe
timtay-microsoft Jun 8, 2023
f87c9d8
javalite
timtay-microsoft Jun 8, 2023
d26a2e3
Update horton_build.py
timtay-microsoft Jun 8, 2023
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
2 changes: 1 addition & 1 deletion bin/build/horton_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
colorama.init(autoreset=True)

default_repo = "(Azure/azure-iot-sdk-BLAH)"
all_languages = ["c", "csharp", "pythonv2", "node", "java"]
all_languages = ["c", "csharp", "pythonv2", "node", "java", "javalite"]

print_separator = "".join("/\\" for _ in range(80))

Expand Down
48 changes: 48 additions & 0 deletions docker_images/javalite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from mcr.microsoft.com/openjdk/jdk:11-mariner

ENV MAVEN_CONFIG=/usr/share/maven/ref

RUN yum install -y \
maven \
git
COPY javalite/settings-docker.xml /usr/share/maven/ref/settings-docker.xml

RUN git config --global user.email "[email protected]" \
&& git config --global user.name "Your Name"

EXPOSE 8080

# force container rebuild when switching from master to main
RUN echo "switch to main" > /horton_tag.txt

# phase 1: grab the base branch and run prebuild
ARG HORTON_REPO
WORKDIR /sdk
RUN git clone https://github.com/$HORTON_REPO .

COPY javalite/prebuild.sh /
RUN /prebuild.sh

# phase 2: grab the code we want to test and rebuild
ARG HORTON_COMMIT_NAME
ARG HORTON_COMMIT_SHA
WORKDIR /sdk
RUN git pull
RUN git checkout $HORTON_COMMIT_SHA

COPY javalite/patchfile /
# our base image might have some files checked out. revert these.
RUN git reset HEAD && git checkout . && git clean -df
RUN if [ -s /patchfile ]; then git apply --index /patchfile; fi

RUN rm -r /sdk/edge-e2e
COPY javalite/wrapper /sdk/edge-e2e

COPY javalite/rebuild.sh /
RUN /rebuild.sh

ENV HORTON_REPO=$HORTON_REPO
ENV HORTON_COMMIT_NAME=$HORTON_COMMIT_NAME
ENV HORTON_COMMIT_SHA=$HORTON_COMMIT_SHA

ENTRYPOINT ["/usr/bin/java", "-jar", "/sdk/iot-e2e-tests/edge-e2e/target/iot-edge-e2e-wrapper-1.0.0-with-deps.jar"]
Empty file.
9 changes: 9 additions & 0 deletions docker_images/javalite/prebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

cd /sdk
[ $? -eq 0 ] || { echo "cd sdk failed"; exit 1; }

mvn -s /usr/share/maven/ref/settings-docker.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true --projects :iot-edge-e2e-wrapper --also-make install
[ $? -eq 0 ] || { echo "build sdk failed"; exit 1; }

9 changes: 9 additions & 0 deletions docker_images/javalite/rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.

cd /sdk
[ $? -eq 0 ] || { echo "cd sdk failed"; exit 1; }

mvn -s /usr/share/maven/ref/settings-docker.xml -Dmaven.test.skip=true -Dmaven.javadoc.skip=true --projects :iot-edge-e2e-wrapper --also-make install
[ $? -eq 0 ] || { echo "build sdk failed"; exit 1; }

6 changes: 6 additions & 0 deletions docker_images/javalite/settings-docker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>/usr/share/maven/ref/repository</localRepository>
</settings>
1 change: 1 addition & 0 deletions docker_images/javalite/wrapper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Project generated on : 2019-12-25T14:46:26.604Z
119 changes: 119 additions & 0 deletions docker_images/javalite/wrapper/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>iot-device-client-lite-parent</artifactId>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>iot-edge-e2e-wrapper</artifactId>
<version>1.0.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>

<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<version>3.9.9</version>
</dependency>

<dependency>
<groupId>com.github.phiz71</groupId>
<artifactId>vertx-swagger-router</artifactId>
<version>1.6.0</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.12.2</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
</dependency>

<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>${iot-device-client-artifact-id}</artifactId>
<version>${iot-device-client-version}</version>
</dependency>

<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-service-client</artifactId>
<version>2.1.6</version>
</dependency>

<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-unixsocket</artifactId>
<version>0.23</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.microsoft.azure.sdk.iot.e2e.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>with-deps</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.microsoft.azure.sdk.iot.e2e;

import io.swagger.server.api.MainApiVerticle;
import io.vertx.core.Vertx;

public class Main {

public static void main(String[] args) {
Vertx vertx = Vertx.vertx();

MainApiVerticle myVerticle = new MainApiVerticle();

vertx.deployVerticle(myVerticle, res -> {
if (res.succeeded()) {
System.out.println("Deployment id is: " + res.result());
System.out.println("Listening on port " + myVerticle.getServerPort());
} else {
System.out.println("Deployment failed!");
}
});
}
}
35 changes: 35 additions & 0 deletions docker_images/javalite/wrapper/src/main/java/glue/ControlGlue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package glue;

import io.swagger.server.api.model.LogMessage;
import io.swagger.server.api.verticle.ModuleApiImpl;
import io.swagger.server.api.verticle.RegistryApiImpl;
import io.swagger.server.api.verticle.ServiceApiImpl;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;

public class ControlGlue
{
public void Cleanup(Handler<AsyncResult<Void>> handler)
{
ModuleApiImpl._moduleGlue.Cleanup();
RegistryApiImpl._registryGlue.Cleanup();
ServiceApiImpl._serviceGlue.Cleanup();
handler.handle(Future.succeededFuture());
}

public void outputMessage(LogMessage logMessage, Handler<AsyncResult<Void>> handler)
{
System.out.println(logMessage.getMessage());
handler.handle(Future.succeededFuture());
}

public void getCapabilities(Handler<AsyncResult<Object>> handler)
{
JsonObject caps = new JsonObject("{"+
"\"flags\": {}"+
"}");
handler.handle(Future.succeededFuture(caps));
}
}
Loading