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

Update Python deps, Docker base images, NGINX used in tests #289

Merged
merged 7 commits into from
Jun 23, 2022
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
system_testing:
machine:
image: ubuntu-2004:202010-01
image: ubuntu-2204:2022.04.2
steps:
- checkout
- run:
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ updates:
directory: "/test"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/test/environment/grpc"
schedule:
interval: "daily"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ __pycache__

# Test
test-log/

# IDEs
.vscode
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.5
3.10.3
49 changes: 22 additions & 27 deletions Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,37 +1,32 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

ARG OPENTRACING_CPP_VERSION=v1.6.0
ARG NGINX_VERSION=1.19.7
ARG NGINX_VERSION=1.23.0

RUN set -x \
&& apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends --no-install-suggests -y \
build-essential \
gettext \
cmake \
git \
gnupg2 \
software-properties-common \
curl \
python3 \
jq \
ca-certificates \
wget \
libpcre3 libpcre3-dev \
zlib1g-dev \
gcc-8 \
g++-8 \
### Use gcc-8 (the default gcc has this problem when using with address sanitizer:
### https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84428)
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8
build-essential \
gettext \
cmake \
git \
gnupg2 \
software-properties-common \
curl \
python3 \
jq \
ca-certificates \
wget \
libpcre3 libpcre3-dev \
zlib1g-dev

### Build opentracing-cpp
RUN cd / \
&& git clone --depth 1 -b $OPENTRACING_CPP_VERSION https://github.com/opentracing/opentracing-cpp.git \
&& cd opentracing-cpp \
&& mkdir .build && cd .build \
&& cmake -DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTING=OFF .. \
-DBUILD_TESTING=OFF .. \
&& make && make install

COPY ./opentracing /opentracing
Expand All @@ -46,12 +41,12 @@ RUN cd / \
&& export ASAN_OPTIONS=detect_leaks=0 \
&& export CFLAGS="-Wno-error" \
&& auto/configure \
--with-http_auth_request_module \
--with-compat \
--with-debug \
# enables grpc
--with-http_v2_module \
--add-dynamic-module=/opentracing \
--with-http_auth_request_module \
--with-compat \
--with-debug \
# enables grpc
--with-http_v2_module \
--add-dynamic-module=/opentracing \
&& make && make install

CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

WORKDIR /3rd_party

Expand Down
9 changes: 8 additions & 1 deletion ci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
set -x
set -e

# workaround to install docker-compose v1
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

docker version
docker-compose version

pyenv versions
pyenv local 3.8.5
pyenv local 3.10.3
python --version
pip --version
pip install --upgrade pip
Expand Down
20 changes: 10 additions & 10 deletions test/Dockerfile-backend
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

RUN apt-get update \
&& apt-get install -y \
curl \
python3 \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py
&& apt-get install -y \
curl \
python3 \
python3-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python3 get-pip.py \
&& rm get-pip.py

COPY . /app
WORKDIR /app
Expand Down
20 changes: 12 additions & 8 deletions test/environment/app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
from flask import Flask, request

app = Flask(__name__)

@app.route('/has-span-context')

@app.route("/has-span-context")
def has_span_context():
assert 'x-ot-span-context' in request.headers
return 'Flask Dockerized'
assert "x-ot-span-context" in request.headers
return "Flask Dockerized"

@app.route('/has-span-context-redirect')

@app.route("/has-span-context-redirect")
def has_span_context_redirect():
assert 'x-ot-span-context' in request.headers
return '', 301
assert "x-ot-span-context" in request.headers
return "", 301


if __name__ == '__main__':
app.run(debug=True,host='0.0.0.0')
if __name__ == "__main__":
app.run(debug=True, host="0.0.0.0", port="5001")
8 changes: 3 additions & 5 deletions test/environment/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '2'
version: '3'
services:

nginx:
Expand Down Expand Up @@ -30,7 +30,6 @@ services:
- -g
- daemon off;


backend:
image: nginx-opentracing-test/backend
networks:
Expand All @@ -40,9 +39,9 @@ services:
volumes:
- ./app.py:/app/app.py
expose:
- "5000"
- "5001"
ports:
- "5000:5000"
- "5001:5001"

php_fpm:
image: php:7-fpm
Expand Down Expand Up @@ -70,4 +69,3 @@ services:

networks:
testnet: {}

1 change: 1 addition & 0 deletions test/environment/grpc/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.3
11 changes: 10 additions & 1 deletion test/environment/grpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
FROM grpc/python:1.13-onbuild
FROM python:3.10

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt

COPY . /usr/src/app

ENTRYPOINT ["python", "-u"]
CMD ["app.py"]
6 changes: 3 additions & 3 deletions test/environment/grpc/app.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
//
// python3 -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. app.proto

syntax = "proto3";
syntax = "proto3";

service App {
rpc CheckTraceHeader(Empty) returns (Empty);
service App {
rpc CheckTraceHeader(Empty) returns (Empty);
}

message Empty {
Expand Down
81 changes: 16 additions & 65 deletions test/environment/grpc/app_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading