Skip to content

Commit 1b110a5

Browse files
authored
Merge pull request #13 from opentelekomcloud-infra/metric
Metric reimplementation
2 parents 551d97d + ebfe3c4 commit 1b110a5

35 files changed

Lines changed: 2548 additions & 314 deletions

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.eggs/**
22
.tox/**
33
.stestr/**
4+
wrk/**
5+
wrk_executor/**

.zuul.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,36 @@
99
vars: &apimon_image_vars
1010
docker_images:
1111
- context: .
12-
repository: otcinfra/apimon
12+
repository: opentelekomcloud/apimon
1313
tags:
1414
# If zuul.tag is defined: [ '3', '3.19', '3.19.0' ]. Only works for 3-component tags.
1515
# Otherwise: ['latest']
1616
&imagetag "{{ zuul.tag is defined | ternary([zuul.get('tag', '').split('.')[0], '.'.join(zuul.get('tag', '').split('.')[:2]), zuul.get('tag', '')], ['latest']) }}"
1717

1818
- job:
1919
name: apimon-upload-image
20-
parent: otcinfra-upload-image
20+
parent: otcinfra-upload-image-quay
2121
provides: apimon-container-image
2222
vars: *apimon_image_vars
2323

2424
- job:
2525
name: apimon-promote-image
26-
parent: otcinfra-promote-image
26+
parent: otcinfra-promote-image-quay
2727
vars: *apimon_image_vars
2828

2929
- project:
3030
merge-mode: squash-merge
3131
check:
3232
jobs:
33-
- tox-pep8
34-
- tox-py38
33+
- otc-tox-pep8
34+
- otc-tox-py38
3535
- apimon-build-image
3636
check-post:
3737
jobs:
3838
- apimon-upload-image
3939
gate:
4040
jobs:
41-
- tox-pep8
41+
- otc-tox-pep8
4242
- apimon-upload-image
4343
promote:
4444
jobs:

Dockerfile

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,40 @@
1010
# implied.
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
13-
FROM fedora:32
13+
FROM fedora:33
1414

15-
RUN dnf --disablerepo updates-modular --disablerepo fedora-modular \
16-
install -y git gcc python3-devel python3-setuptools python3-pip nmap-ncat procps-ng
15+
LABEL description="APImon (OpenStack API monitoring) container"
16+
LABEL maintainer="Open Telekom Cloud (ecosystem)"
1717

18-
WORKDIR /usr/app
19-
ENV PATH=/root/.local/bin:$PATH
20-
RUN mkdir -p /var/{lib/apimon,log/apimon}
18+
RUN dnf --disablerepo updates-modular --disablerepo fedora-modular \
19+
install -y git gcc nmap-ncat procps-ng net-tools xz \
20+
python3-devel python3-setuptools python3-pip \
21+
python3-psycopg2 python3-sqlalchemy \
22+
python3-dns && dnf clean all
2123

2224
RUN git config --global user.email "apimon@test.com"
2325
RUN git config --global user.name "apimon"
2426

27+
RUN useradd apimon
28+
29+
RUN mkdir -p /var/{lib/apimon,log/apimon,log/executor,log/scheduler}
30+
31+
RUN chown apimon:apimon /var/lib/apimon && chown -R apimon:apimon /var/log/apimon
32+
33+
WORKDIR /usr/app
34+
2535
COPY ./requirements.txt /usr/app/requirements.txt
2636

27-
#RUN git clone https://github.com/ansible/ansible --branch stable-2.10 && \
28-
# git clone https://review.opendev.org/openstack/openstacksdk
37+
RUN \
38+
git clone https://github.com/opentelekomcloud/python-otcextensions && \
39+
# git clone https://github.com/ansible/ansible --branch stable-2.10 && \
40+
git clone https://review.opendev.org/openstack/openstacksdk
2941

30-
#RUN cd ansible && python3 setup.py install --user
42+
RUN pip3 install -r /usr/app/requirements.txt
3143

32-
RUN pip3 install --user -r /usr/app/requirements.txt
44+
#RUN cd ansible && python3 setup.py install --user
45+
RUN cd openstacksdk && python3 setup.py install --force
46+
RUN cd python-otcextensions && python3 setup.py install --force
3347

3448
ADD . /usr/app/apimon
3549

@@ -39,8 +53,10 @@ ADD . /usr/app/apimon
3953
# && git checkout FETCH_HEAD \
4054
# && python3 setup.py install --user
4155

42-
RUN cd apimon && python3 setup.py install --user
56+
RUN cd apimon && python3 setup.py install
57+
58+
RUN rm -rf /usr/app/{ansible,apimon,python-otcextensions}
4359

44-
RUN rm -rf /usr/app/ansible
60+
USER apimon
4561

46-
ENV PATH=/root/.local/bin:$PATH
62+
ENV HOME=/home/apimon

apimon/ansible/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)