Skip to content

Commit aedfa10

Browse files
nour-massrilowtorola
authored andcommitted
adding development pub/sub image with pubsub client to send messages and test
1 parent bac9921 commit aedfa10

File tree

7 files changed

+509
-0
lines changed

7 files changed

+509
-0
lines changed

saturn/development/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use an official Golang image as a parent image
2+
FROM golang:1.23
3+
4+
# Install Google Cloud SDK
5+
RUN apt-get update && apt-get install -y curl gnupg rlwrap && \
6+
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
7+
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
8+
apt-get update && apt-get install -y google-cloud-sdk google-cloud-sdk-pubsub-emulator
9+
10+
# Install Pub/Sub emulator
11+
RUN apt-get install google-cloud-cli-pubsub-emulator
12+
13+
# Copy the start script
14+
COPY startpubsub.sh /usr/local/bin/startpubsub.sh
15+
RUN chmod +x /usr/local/bin/startpubsub.sh
16+
17+
# Set the working directory
18+
WORKDIR /app
19+
20+
# Copy the Go application code
21+
COPY . /app
22+
RUN go mod download
23+
RUN go build -o pubsubclient pubsubclient.go
24+
# Expose the Pub/Sub emulator port
25+
EXPOSE 8514
26+
27+
# Run the entry point script
28+
ENTRYPOINT ["rlwrap", "/usr/local/bin/startpubsub.sh"]

saturn/development/compile.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"episode": {
3+
"name": "bc25python",
4+
"language": "py3",
5+
"scaffold": "https://github.com/battlecode/battlecode25-scaffold"
6+
},
7+
"metadata": {
8+
"report-url": "/development/test/report.txt",
9+
"task-type": "compile"
10+
},
11+
"details": {
12+
"source": {
13+
"bucket": "local",
14+
"name": "/development/test/python.zip"
15+
},
16+
"binary": {
17+
"bucket": "local",
18+
"name": "/development/test/binary.zip"
19+
},
20+
"team-name": "test",
21+
"package": "examplefuncsplayer"
22+
}
23+
}

saturn/development/execute.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"episode": {
3+
"name": "bc25java",
4+
"language": "java21",
5+
"scaffold": "https://github.com/battlecode/battlecode25-scaffold"
6+
},
7+
"metadata": {
8+
"report-url": "/development/test/report.txt",
9+
"task-type": "execute"
10+
},
11+
"details": {
12+
"maps": [
13+
"fix",
14+
"galaxy",
15+
"gridworld",
16+
"quack",
17+
"sierpinski"
18+
],
19+
"replay": {
20+
"bucket": "local",
21+
"name": "/development/test/replay.bc25java"
22+
},
23+
"alternate-order": true,
24+
"a": {
25+
"source": {
26+
"bucket": "local",
27+
"name": "/development/test/source1.zip"
28+
},
29+
"binary": {
30+
"bucket": "local",
31+
"name": "/development/test/binary1.zip"
32+
},
33+
"team-name": "test1",
34+
"package": "examplefuncsplayer"
35+
},
36+
"b": {
37+
"source": {
38+
"bucket": "local",
39+
"name": "/development/test/source2.zip"
40+
},
41+
"binary": {
42+
"bucket": "local",
43+
"name": "/development/test/binary2.zip"
44+
},
45+
"team-name": "test2",
46+
"package": "examplefuncsplayer"
47+
}
48+
}
49+
}

saturn/development/go.mod

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module github.com/battlecode/galaxy
2+
3+
go 1.23
4+
5+
require (
6+
cloud.google.com/go/pubsub v1.45.3
7+
google.golang.org/api v0.217.0
8+
)
9+
10+
require (
11+
cloud.google.com/go v0.116.0 // indirect
12+
cloud.google.com/go/auth v0.14.0 // indirect
13+
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
14+
cloud.google.com/go/compute/metadata v0.6.0 // indirect
15+
cloud.google.com/go/iam v1.2.2 // indirect
16+
github.com/felixge/httpsnoop v1.0.4 // indirect
17+
github.com/go-logr/logr v1.4.2 // indirect
18+
github.com/go-logr/stdr v1.2.2 // indirect
19+
github.com/google/s2a-go v0.1.9 // indirect
20+
github.com/google/uuid v1.6.0 // indirect
21+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
22+
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
23+
go.opencensus.io v0.24.0 // indirect
24+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
25+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
26+
go.opentelemetry.io/otel v1.31.0 // indirect
27+
go.opentelemetry.io/otel/metric v1.31.0 // indirect
28+
go.opentelemetry.io/otel/trace v1.31.0 // indirect
29+
golang.org/x/crypto v0.32.0 // indirect
30+
golang.org/x/net v0.34.0 // indirect
31+
golang.org/x/oauth2 v0.25.0 // indirect
32+
golang.org/x/sync v0.10.0 // indirect
33+
golang.org/x/sys v0.29.0 // indirect
34+
golang.org/x/text v0.21.0 // indirect
35+
golang.org/x/time v0.9.0 // indirect
36+
google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect
37+
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
38+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect
39+
google.golang.org/grpc v1.69.4 // indirect
40+
google.golang.org/protobuf v1.36.2 // indirect
41+
)

0 commit comments

Comments
 (0)