forked from armadaproject/armada
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start making some Armada GRPC test calls.
Add functions for querying Armada GRPC endpoints for health and job status. Also, use symlinks to armada protobuf directory and add for gogo protobuf file. Add (commented-out) attempt to use sbt protoc path inclusion in build.sbt, but it does not yet work.
- Loading branch information
Showing
7 changed files
with
28 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../proto/armada |
296 changes: 0 additions & 296 deletions
296
client/scala/scala-armada-client/src/main/protobuf/armada/event.proto
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/scala/scala-armada-client/src/main/protobuf/armada/health.proto
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
client/scala/scala-armada-client/src/main/protobuf/armada/submit.proto
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
client/scala/scala-armada-client/src/main/protobuf/github.com/gogo/protobuf/gogoproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../../../../../proto/github.com/gogo/protobuf/gogoproto |
27 changes: 22 additions & 5 deletions
27
client/scala/scala-armada-client/src/main/scala/Main.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,27 @@ | ||
import api.event.EventGrpc | ||
import api.health.HealthCheckResponse | ||
import api.submit.Job | ||
import com.google.protobuf.empty | ||
import io.grpc.ManagedChannelBuilder | ||
import queryapi.queryapi.QueryApiGrpc | ||
import queryapi.queryapi.JobStatusResponse | ||
|
||
@main def hello(): Unit = | ||
println("Hello world!") | ||
val host = "localhost" | ||
val port = 30002 | ||
|
||
Job(id = "test ID") | ||
@main def getArmadaHealth(): Unit = | ||
val channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build | ||
val blockingStub = EventGrpc.blockingStub(channel) | ||
|
||
println(msg) | ||
val reply: HealthCheckResponse = blockingStub.health(empty.Empty()) | ||
|
||
def msg = "I was compiled by Scala 3. :) api.submit.Job exists" | ||
println(reply.status) | ||
|
||
def getJobStatus(): Unit = | ||
val channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build | ||
val blockingStub = QueryApiGrpc.blockingStub(channel) | ||
|
||
val jsReq = queryapi.queryapi.JobStatusRequest(jobId = "foobar") | ||
val reply: queryapi.queryapi.JobStatusResponse = blockingStub.getJobStatus(jsReq) | ||
|
||
println(reply) |