-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: Add vdk-heartbeat image
As part of the the CI/CD process, we could benefit from having the vdk-heartbeat package built as a docker image. This change adds a dockerfile to facilitate building the vdk-heartbeat docker image when a new release of the Control Service is made. Testing Done: Built the image in docker locally and ran it to verify that it is being executed as expected. Signed-off-by: Andon Andonov <[email protected]>
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Install all required packages and prepare vdk heartbeat | ||
FROM python:3.7-slim AS builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends build-essential gcc | ||
|
||
RUN python -m venv /opt/buildenv | ||
ENV PATH="/opt/buildenv/bin:$PATH" | ||
|
||
RUN pip install -U pip wheel | ||
RUN pip install vdk-heartbeat | ||
|
||
|
||
# Prepare the release heartbeat | ||
FROM python:3.7-slim | ||
|
||
COPY --from=builder /opt/buildenv /opt/buildenv | ||
COPY vdk_heartbeat_config.ini heartbeat_config.ini | ||
COPY start_heartbeat.sh . | ||
|
||
RUN ["chmod", "+x", "start_heartbeat.sh"] | ||
|
||
ENV PATH="/opt/buildenv/bin:$PATH" | ||
|
||
CMD ["./start_heartbeat.sh", "heartbeat_config.ini"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2021 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
VDK_HEARTBEAT_VDK_DISTRIBUTION_NAME=${VDK_HEARTBEAT_VDK_DISTRIBUTION_NAME:-'quickstart-vdk'} | ||
VDK_HEARTBEAT_PIP_EXTRA_INDEX_URL=${VDK_HEARTBEAT_PIP_EXTRA_INDEX_URL:-'https://pypi.org/simple'} | ||
|
||
pip install -U $VDK_HEARTBEAT_VDK_DISTRIBUTION_NAME --extra-index-url $VDK_HEARTBEAT_PIP_EXTRA_INDEX_URL | ||
|
||
vdk-heartbeat -f $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[DEFAULT] | ||
# Genereate with https://console-stg.cloud.vmware.com/csp/gateway/portal/#/user/tokens | ||
# VDKCLI_OAUTH2_REFRESH_TOKEN= passed as environment variable | ||
|
||
JOB_RUN_TEST_MODULE_NAME=vdk.internal.heartbeat.simple_run_test | ||
JOB_RUN_TEST_CLASS_NAME=SimpleRunTest | ||
DATAJOB_DIRECTORY_NAME=simple | ||
|
||
VDK_COMMAND_NAME=vdk | ||
|
||
REPORT_JUNIT_XML_FILE_PATH=/reports/tests.xml |