This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +100
-2
lines changed Expand file tree Collapse file tree 6 files changed +100
-2
lines changed Original file line number Diff line number Diff line change @@ -55,3 +55,4 @@ script:
55
55
# Second, HTTP.
56
56
- ./examples/hellohttp/e2e-test.sh java
57
57
- ./examples/hellohttp/e2e-test.sh go
58
+ - ./examples/hellohttp/e2e-test.sh py
Original file line number Diff line number Diff line change @@ -148,9 +148,24 @@ pip_import(
148
148
requirements = "//examples/hellogrpc/py:requirements.txt" ,
149
149
)
150
150
151
- load ("@examples_helloworld_pip//:requirements.bzl" , "pip_install" )
151
+ load (
152
+ "@examples_helloworld_pip//:requirements.bzl" ,
153
+ grpcpip_install = "pip_install" ,
154
+ )
155
+
156
+ grpcpip_install ()
157
+
158
+ pip_import (
159
+ name = "examples_hellohttp_pip" ,
160
+ requirements = "//examples/hellohttp/py:requirements.txt" ,
161
+ )
162
+
163
+ load (
164
+ "@examples_hellohttp_pip//:requirements.bzl" ,
165
+ httppip_install = "pip_install" ,
166
+ )
152
167
153
- pip_install ()
168
+ httppip_install ()
154
169
155
170
# We use py_image to build a sample service
156
171
load (
Original file line number Diff line number Diff line change
1
+ # Copyright 2017 The Bazel Authors. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ package (default_visibility = ["//visibility:public" ])
15
+
16
+ licenses (["notice" ]) # Apache 2.0
17
+
18
+ load ("@examples_hellohttp_pip//:requirements.bzl" , "all_requirements" )
19
+ load ("@io_bazel_rules_docker//python:image.bzl" , "py_image" )
20
+
21
+ py_image (
22
+ name = "server" ,
23
+ srcs = ["server.py" ],
24
+ main = "server.py" ,
25
+ deps = all_requirements ,
26
+ )
27
+
28
+ load ("@k8s_deploy//:defaults.bzl" , "k8s_deploy" )
29
+
30
+ k8s_deploy (
31
+ name = "staging" ,
32
+ images = {
33
+ "us.gcr.io/not-my-project/hello-http:staging" : ":server" ,
34
+ },
35
+ template = "//examples/hellohttp:deployment.yaml" ,
36
+ )
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ # Copyright 2017 The Bazel Authors. All rights reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ SUFFIX=" $1 "
18
+
19
+ sed -i " s/DEMO *[a-z0-9_-]* */DEMO${SUFFIX} /g" ./examples/hellohttp/py/server.py
Original file line number Diff line number Diff line change
1
+ Flask == 0.12.2
2
+ gunicorn == 19.4.5
Original file line number Diff line number Diff line change
1
+ # Copyright 2017 The Bazel Authors. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Demo HTTP application."""
15
+
16
+ from flask import Flask
17
+
18
+ app = Flask (__name__ )
19
+
20
+ @app .route ('/' )
21
+ def get ():
22
+ return 'DEMO '
23
+
24
+ if __name__ == '__main__' :
25
+ app .run (host = '0.0.0.0' , port = 8080 , debug = True )
You can’t perform that action at this time.
0 commit comments