Skip to content

Commit 32fa647

Browse files
committed
Merge commit '02e64a9' into release
2 parents eeace3d + 02e64a9 commit 32fa647

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5502
-1403
lines changed

.circleci/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- setup_remote_docker:
4242
docker_layer_caching: true
4343
- run:
44-
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.6 scalyr/scalyr-agent-ci-unittest:2 /tmp/unittest.sh
44+
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.6 scalyr/scalyr-agent-ci-unittest:4 /tmp/unittest.sh
4545

4646
unittest-25:
4747
docker:
@@ -50,7 +50,7 @@ jobs:
5050
- setup_remote_docker:
5151
docker_layer_caching: true
5252
- run:
53-
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.5 scalyr/scalyr-agent-ci-unittest:2 /tmp/unittest.sh
53+
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.5 scalyr/scalyr-agent-ci-unittest:4 /tmp/unittest.sh
5454

5555
unittest-24:
5656
docker:
@@ -59,7 +59,7 @@ jobs:
5959
- setup_remote_docker:
6060
docker_layer_caching: true
6161
- run:
62-
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.4 scalyr/scalyr-agent-ci-unittest:2 /tmp/unittest.sh
62+
command: docker run -it -e TEST_BRANCH=${CIRCLE_BRANCH} -e PYTHON_VERSION=2.4 scalyr/scalyr-agent-ci-unittest:4 /tmp/unittest.sh
6363

6464
smoke-standalone-27:
6565
docker:
@@ -72,7 +72,7 @@ jobs:
7272
command: |
7373
docker container create --name dummy -v shared_vol:/app alpine && \
7474
docker cp $(pwd)/.circleci/smoketest_standalone.sh dummy:/app/ && \
75-
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.7 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:2 /app/smoketest_standalone.sh && \
75+
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.7 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:4 /app/smoketest_standalone.sh && \
7676
docker rm dummy;
7777
smoke-standalone-26:
7878
docker:
@@ -85,7 +85,7 @@ jobs:
8585
command: |
8686
docker container create --name dummy -v shared_vol:/app alpine && \
8787
docker cp $(pwd)/.circleci/smoketest_standalone.sh dummy:/app/ && \
88-
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.6 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:2 /tmp/smoketest_standalone.sh && \
88+
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.6 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:4 /app/smoketest_standalone.sh && \
8989
docker rm dummy;
9090
smoke-standalone-25:
9191
docker:
@@ -98,7 +98,7 @@ jobs:
9898
command: |
9999
docker container create --name dummy -v shared_vol:/app alpine && \
100100
docker cp $(pwd)/.circleci/smoketest_standalone.sh dummy:/app/ && \
101-
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.5 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:2 /tmp/smoketest_standalone.sh && \
101+
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.5 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:4 /app/smoketest_standalone.sh && \
102102
docker rm dummy
103103
smoke-standalone-24:
104104
docker:
@@ -111,7 +111,7 @@ jobs:
111111
command: |
112112
docker container create --name dummy -v shared_vol:/app alpine && \
113113
docker cp $(pwd)/.circleci/smoketest_standalone.sh dummy:/app/ && \
114-
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.4 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:2 /tmp/smoketest_standalone.sh && \
114+
docker run -it -v shared_vol:/app -e TEST_BRANCH=${CIRCLE_BRANCH} -e MAX_WAIT=300 -e PYTHON_VERSION=2.4 -e SCALYR_API_KEY=${SCALYR_API_KEY} -e READ_API_KEY=${READ_API_KEY} -e SCALYR_SERVER=${SCALYR_SERVER} -e CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM} scalyr/scalyr-agent-ci-unittest:4 /app/smoketest_standalone.sh && \
115115
docker rm dummy
116116
smoke-docker-json:
117117
docker:
@@ -132,7 +132,7 @@ jobs:
132132
paths:
133133
- "venv"
134134
- run:
135-
command: source ./.circleci/smoketest_docker.sh scalyr/scalyr-agent-ci-unittest:2 json 300
135+
command: source ./.circleci/smoketest_docker.sh scalyr/scalyr-agent-ci-unittest:4 json 300
136136

137137
smoke-docker-syslog:
138138
docker:
@@ -153,7 +153,7 @@ jobs:
153153
paths:
154154
- "venv"
155155
- run:
156-
command: source ./.circleci/smoketest_docker.sh scalyr/scalyr-agent-ci-unittest:2 syslog 300
156+
command: source ./.circleci/smoketest_docker.sh scalyr/scalyr-agent-ci-unittest:4 syslog 300
157157

158158
smoke-k8s:
159159
machine:
@@ -202,7 +202,7 @@ jobs:
202202
- run:
203203
name: build k8s agent and run smoketest
204204
command: |
205-
source ./.circleci/smoketest_k8s.sh scalyr/scalyr-agent-ci-unittest:2 300 no_delete_existing_k8s_objs
205+
source ./.circleci/smoketest_k8s.sh scalyr/scalyr-agent-ci-unittest:4 300 no_delete_existing_k8s_objs
206206
207207
smoke-k8s-helm:
208208
machine:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#--------------------------------------------------------------------------------------------------
2+
# This dockerfile builds a minimal centos-based image for running a sanity smoketest during the
3+
# automated release process.
4+
#
5+
# It requires the same files/assets as the unified smoke/unit Dockerfile
6+
#
7+
# Example build command:
8+
# docker build -f <thisfile> -t scalyr/scalyr-agent-ci-sanity:centos.1 .
9+
#--------------------------------------------------------------------------------------------------
10+
11+
FROM centos
12+
13+
RUN yum install -y epel-release && yum install -y python36 python36-pip
14+
RUN pip3 install requests
15+
RUN yum install -y perl
16+
17+
#------------------------------------------------------
18+
# Copy and run test scripts
19+
#------------------------------------------------------
20+
COPY unittest smoketest /tmp/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#--------------------------------------------------------------------------------------------------
2+
# This dockerfile builds a minimal ubuntu-based image for running a sanity smoketest during the
3+
# automated release process.
4+
#
5+
# It requires the same files/assets as the unified smoke/unit Dockerfile
6+
#
7+
# Example build command:
8+
# docker build -f <thisfile> -t scalyr/scalyr-agent-ci-sanity:ubuntu.1 .
9+
#--------------------------------------------------------------------------------------------------
10+
11+
FROM ubuntu
12+
13+
RUN apt-get update && apt-get install -y curl python python3
14+
RUN apt-get install -y python3-pip
15+
RUN apt-get install perl
16+
RUN pip3 install requests
17+
18+
#------------------------------------------------------
19+
# Copy and run test scripts
20+
#------------------------------------------------------
21+
COPY unittest smoketest /tmp/
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#--------------------------------------------------------------------------------------------------
2+
# This dockerfile builds the unified image for running Scalyr agent unit & smoke tests
3+
#
4+
# It requires the following files:
5+
#
6+
# smoketest
7+
# override_files
8+
# agent.json (agent config file with placeholder serverHost token)
9+
# smoketest.py (main smoketest python script)
10+
# unittest
11+
# unittest.sh (unittest script)
12+
#--------------------------------------------------------------------------------------------------
13+
14+
FROM centos
15+
16+
RUN yum install -y sudo gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel which wget
17+
RUN yum install -y libffi-devel
18+
RUN yum install -y ruby-devel gcc make rpm-build rubygems # fpm needed for building rpm
19+
RUN yum install -y initscripts
20+
# Install fpm globally
21+
RUN gem install --no-user-install --no-ri --no-rdoc fpm
22+
RUN yum -y install net-tools
23+
RUN yum install -y epel-release && yum install -y python36 python36-pip
24+
RUN pip3 install requests
25+
26+
RUN useradd -ms /bin/bash scalyr \
27+
&& echo "scalyr:scalyr" | chpasswd \
28+
&& usermod -aG wheel scalyr \
29+
&& echo "scalyr ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
30+
31+
# Install pyenv versions
32+
33+
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv \
34+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
35+
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
36+
&& echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
37+
38+
RUN source ~/.bashrc && pyenv install 3.7.3
39+
RUN source ~/.bashrc && pyenv install 2.7.12
40+
RUN source ~/.bashrc && pyenv install 2.6.9
41+
RUN source ~/.bashrc && pyenv install 2.5.4
42+
RUN source ~/.bashrc && pyenv install 2.4.1
43+
44+
RUN source ~/.bashrc && pyenv shell 3.7.3 && pip3 install requests
45+
RUN source ~/.bashrc && pyenv shell 2.7.12 && pip install ujson mock
46+
RUN source ~/.bashrc && pyenv shell 2.6.9 && pip install ujson mock
47+
48+
# Python 2.5 and below requires libssl.so which we need to build
49+
# Also cannot install mock library with pip as it keeps upgrading to incompatible version
50+
# Instead download source and build
51+
RUN source ~/.bashrc && pyenv shell 2.5.4 \
52+
&& pushd /tmp \
53+
&& wget https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz \
54+
&& tar zxvf ssl-1.16.tar.gz \
55+
&& cd ssl-1.16 \
56+
&& sudo ln -s /usr/lib64/libssl.so /usr/lib \
57+
&& make && make install \
58+
&& popd \
59+
&& pip install ujson \
60+
&& pushd /tmp && wget https://files.pythonhosted.org/packages/52/22/05f0fb67c51e86b485914b1da519b2df6afd36c41f81a21328bc69a2e3b1/mock-0.8.0.tar.gz \
61+
&& tar zxf mock-0.8.0.tar.gz && cd mock-0.8.0 && python setup.py build && python setup.py install
62+
63+
# Install Python 2.4 packages
64+
RUN source ~/.bashrc && pyenv shell 2.4.1 \
65+
&& pip install --index-url=https://pypi.python.org/simple/ ujson \
66+
&& pushd /tmp/mock-0.8.0 && python setup.py build && python setup.py install
67+
68+
#------------------------------------------------------
69+
# Copy pyenv to scalyr user
70+
#------------------------------------------------------
71+
# RUN sudo cp ~scalyr/.bashrc /root/.bashrc
72+
# RUN sudo ln -s ~scalyr/.pyenv /root/.pyenv
73+
# RUN gem install --no-ri --no-rdoc fpm
74+
75+
USER scalyr
76+
WORKDIR /home/scalyr
77+
78+
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv \
79+
&& echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc \
80+
&& echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc \
81+
&& echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
82+
83+
RUN source ~/.bashrc && pyenv install 3.7.3
84+
RUN source ~/.bashrc && pyenv install 2.7.12
85+
RUN source ~/.bashrc && pyenv install 2.6.9
86+
RUN source ~/.bashrc && pyenv install 2.5.4
87+
RUN source ~/.bashrc && pyenv install 2.4.1
88+
89+
RUN source ~/.bashrc && pyenv shell 3.7.3 && pip3 install requests
90+
RUN source ~/.bashrc && pyenv shell 2.7.12 && pip install ujson mock
91+
RUN source ~/.bashrc && pyenv shell 2.6.9 && pip install ujson mock
92+
93+
# Python 2.5 and below requires libssl.so which we need to build
94+
# Also cannot install mock library with pip as it keeps upgrading to incompatible version
95+
# Instead download source and build
96+
RUN sudo rm -rf /tmp/ssl-1.16
97+
RUN sudo rm -rf /tmp/mock-0.8.0
98+
99+
# Install Python 2.5 packages AND fix mock library install locations (otherwise unittest-25 fails)
100+
RUN source ~/.bashrc && pyenv shell 2.5.4 \
101+
&& pushd /tmp \
102+
&& wget https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz \
103+
&& tar zxvf ssl-1.16.tar.gz \
104+
&& cd ssl-1.16 \
105+
&& sudo ln -sf /usr/lib64/libssl.so /usr/lib \
106+
&& make && make install \
107+
&& popd \
108+
&& pip install ujson \
109+
&& pushd /tmp && wget https://files.pythonhosted.org/packages/52/22/05f0fb67c51e86b485914b1da519b2df6afd36c41f81a21328bc69a2e3b1/mock-0.8.0.tar.gz \
110+
&& tar zxf mock-0.8.0.tar.gz && cd mock-0.8.0 && python setup.py build && sudo python setup.py install --prefix=/home/scalyr/.pyenv/versions/2.5.4 \
111+
&& sudo chown -R scalyr:scalyr /home/scalyr/.pyenv/versions/2.5.4/lib/python2.7 \
112+
&& mv /home/scalyr/.pyenv/versions/2.5.4/lib/python2.7/site-packages/* /home/scalyr/.pyenv/versions/2.5.4/lib/python2.5/site-packages
113+
114+
# Install Python 2.4 packages AND fix mock library install locations (otherwise unittest-24 fails)
115+
RUN source ~/.bashrc && pyenv shell 2.4.1 \
116+
&& pip install --index-url=https://pypi.python.org/simple/ ujson \
117+
&& pushd /tmp/mock-0.8.0 && sudo python setup.py build && sudo python setup.py install --prefix=/home/scalyr/.pyenv/versions/2.4.1 --prefix=/home/scalyr/.pyenv/versions/2.4.1 \
118+
&& sudo chown -R scalyr:scalyr /home/scalyr/.pyenv/versions/2.4.1/lib/python2.7 \
119+
&& mv /home/scalyr/.pyenv/versions/2.4.1/lib/python2.7/site-packages/* /home/scalyr/.pyenv/versions/2.4.1/lib/python2.4/site-packages
120+
121+
#------------------------------------------------------
122+
# Python 2.6 and 2.7 with non-working ssl
123+
#------------------------------------------------------
124+
RUN source ~/.bashrc && pyenv install 2.6.6
125+
RUN source ~/.bashrc && pyenv install 2.7.2
126+
RUN mv /home/scalyr/.pyenv/versions/2.6.6/lib/python2.6/ssl.py /home/scalyr/.pyenv/versions/2.6.6/lib/python2.6/ssl_hide.py
127+
RUN /bin/rm -f /home/scalyr/.pyenv/versions/2.6.6/lib/python2.6/ssl.pyc
128+
RUN mv /home/scalyr/.pyenv/versions/2.7.2/lib/python2.7/ssl.py /home/scalyr/.pyenv/versions/2.7.2/lib/python2.7/ssl_hide.py
129+
RUN /bin/rm -f /home/scalyr/.pyenv/versions/2.7.2/lib/python2.7/ssl.pyc
130+
131+
#------------------------------------------------------
132+
# Copy and run test scripts
133+
#------------------------------------------------------
134+
COPY unittest smoketest /tmp/
135+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Fields describing this server. These fields are attached to each log message, and
3+
// can be used to filter data from a particular server or group of servers.
4+
server_attributes: {
5+
// Fill in this field if you'd like to override the server's hostname.
6+
serverHost: "ci-agent-standalone-CIRCLE_BUILD_NUM",
7+
8+
// You can add whatever additional fields you'd like.
9+
// tier: "production"
10+
}
11+
12+
// Log files to upload to Scalyr. You can use '*' wildcards here.
13+
logs: [
14+
{ path: "/var/log/scalyr-agent-2/data.json", attributes: {parser: "json"} }
15+
],
16+
}

0 commit comments

Comments
 (0)