Skip to content

Commit

Permalink
tests/cstrans-df-run: cover the --shell-form option
Browse files Browse the repository at this point in the history
  • Loading branch information
kdudka committed Feb 6, 2025
1 parent b87e7a4 commit b05206d
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 5 deletions.
38 changes: 38 additions & 0 deletions tests/cstrans-df-run/0001-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager
ARG BUILD_PROMU=false
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'cd ${ALERTMANAGER_GOPATH} && yum install -y prometheus-promu && make build && yum clean all'

FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

ARG ALERTMANAGER_GOPATH=/go/src/github.com/prometheus/alertmanager
COPY --from=builder ${ALERTMANAGER_GOPATH}/amtool /bin/amtool
COPY --from=builder ${ALERTMANAGER_GOPATH}/alertmanager /bin/alertmanager
COPY --from=builder ${ALERTMANAGER_GOPATH}/examples/ha/alertmanager.yml /etc/alertmanager/alertmanager.yml

EXPOSE 9093
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'mkdir -p /alertmanager'
VOLUME [ "/alertmanager" ]
WORKDIR /etc/alertmanager
ENTRYPOINT [ "/bin/alertmanager" ]
CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>" \
name="openshift/ose-prometheus-alertmanager" \
License="ASL 2.0" \
io.k8s.display-name="Prometheus Alert Manager" \
io.openshift.build.source-location="https://github.com/openshift/prometheus-alertmanager" \
io.openshift.build.commit.url="https://github.com/openshift/prometheus-alertmanager/commit/39c2c111ea818cd16dbd11e31cc682cf2b4042d3" \
version="v4.1.0" \
io.openshift.build.commit.id="39c2c111ea818cd16dbd11e31cc682cf2b4042d3" \
release="201905191700" \
vendor="Red Hat" \
io.openshift.tags="openshift,prometheus"

13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0002-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'cd ${ALERTMANAGER_GOPATH} && yum install -y prometheus-promu && make build && yum clean all'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0003-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'make'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0004-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'go' 'build' '--verbose'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0005-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'echo \"OK\"'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0006-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'echo \"OK\"'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
79 changes: 79 additions & 0 deletions tests/cstrans-df-run/0007-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#
# This is the OpenShift ovn overlay network image.
# it provides an overlay network using ovs/ovn/ovn-kube
#
# The standard name for this image is ovn-kube

# Notes:
# This is for a build where the ovn-kubernetes utilities
# are built in this Dockerfile and included in the image (instead of the rpm)
#

FROM openshift/golang-builder:1.10 AS builder
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b

WORKDIR /go-controller
COPY go-controller/ .

# build the binaries
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'make'

FROM openshift/ose-cli:v4.1.0-201905191700 AS cli
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b

FROM openshift/ose-base:v4.1.0-201905191700
ENV SOURCE_GIT_COMMIT=674977b1fdf0f966970179b9fae338f8347b2dfe SOURCE_GIT_TAG=674977b

USER root

ENV PYTHONDONTWRITEBYTECODE yes

# install needed rpms - openvswitch must be 2.9.2 or higher
# install selinux-policy first to avoid a race
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'yum install -y \tselinux-policy && \tyum clean all'

RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'yum install -y \tPyYAML bind-utils \topenssl \tnumactl-libs \tfirewalld-filesystem \tlibpcap \thostname \t\"openvswitch2.11\" \t\"openvswitch2.11-ovn-common\" \t\"openvswitch2.11-ovn-central\" \t\"openvswitch2.11-ovn-host\" \t\"openvswitch2.11-ovn-vtep\" \t\"openvswitch2.11-devel\" \tcontainernetworking-plugins \tiproute strace socat && \tyum clean all'

RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'rm -rf /var/cache/yum'

RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'mkdir -p /var/run/openvswitch && mkdir -p /etc/cni/net.d && mkdir -p /opt/cni/bin && mkdir -p /usr/libexec/cni/'

COPY --from=builder /go-controller/_output/go/bin/ovnkube /usr/bin/
COPY --from=builder /go-controller/_output/go/bin/ovn-kube-util /usr/bin/
COPY --from=builder /go-controller/_output/go/bin/ovn-k8s-cni-overlay /usr/libexec/cni/ovn-k8s-cni-overlay

COPY --from=cli /usr/bin/oc /usr/bin
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'ln -s /usr/bin/oc /usr/bin/kubectl'

# copy git commit number into image
COPY .git/HEAD /root/.git/HEAD
COPY .git/refs/heads/ /root/.git/refs/heads/

# ovnkube.sh is the entry point. This script examines environment
# variables to direct operation and configure ovn
COPY dist/images/ovnkube.sh /root/
COPY dist/images/ovn-debug.sh /root/
# override the rpm's ovn_k8s.conf with this local copy
COPY dist/images/ovn_k8s.conf /etc/openvswitch/ovn_k8s.conf



WORKDIR /root
ENTRYPOINT /root/ovnkube.sh

LABEL \
io.k8s.description="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
com.redhat.component="ose-ovn-kubernetes-container" \
maintainer="Phil Cameron <pcameron@redhat.com>" \
name="openshift/ose-ovn-kubernetes" \
License="GPLv2+" \
io.k8s.display-name="ovn kubernetes" \
io.openshift.build.source-location="https://github.com/openshift/ovn-kubernetes" \
summary="This is a component of OpenShift Container Platform that provides an overlay network using ovn." \
io.openshift.build.commit.url="https://github.com/openshift/ovn-kubernetes/commit/674977b1fdf0f966970179b9fae338f8347b2dfe" \
version="v4.1.0" \
io.openshift.build.commit.id="674977b1fdf0f966970179b9fae338f8347b2dfe" \
release="201905231545" \
vendor="Red Hat" \
io.openshift.tags="openshift"

13 changes: 13 additions & 0 deletions tests/cstrans-df-run/0008-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM openshift/golang-builder:1.11 AS builder
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11
COPY . ${ALERTMANAGER_GOPATH}
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'echo \tOK\n'
FROM ubi7:7.6-159
ENV SOURCE_GIT_COMMIT=39c2c111ea818cd16dbd11e31cc682cf2b4042d3 SOURCE_GIT_TAG=golang-github-prometheus-alertmanager-4.0.0-0.100.0-115-g39c2c11

CMD [ "--storage.path=/alertmanager" ]

LABEL \
io.k8s.description="This is the Prometheus Alert Manager image." \
com.redhat.component="golang-github-prometheus-alertmanager-container" \
maintainer="OpenShift Development <dev@lists.openshift.redhat.com>"
61 changes: 61 additions & 0 deletions tests/cstrans-df-run/0009-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM ubi8/s2i-core:rhel8.1

# RHSCL rh-nginx114 image.

EXPOSE 8080
EXPOSE 8443

ENV NAME=nginx \
NGINX_VERSION=1.14 \
NGINX_SHORT_VER=114 \
VERSION=0

ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \
DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \
protocols, with a strong focus on high concurrency, performance and low memory usage. The container \
image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \
as a base image for other applications based on nginx $NGINX_VERSION web server. \
Nginx server image can be extended using source-to-image tool."

LABEL summary="${SUMMARY}" \
description="${DESCRIPTION}" \
io.k8s.description="${DESCRIPTION}" \
io.k8s.display-name="Nginx ${NGINX_VERSION}" \
io.openshift.expose-services="8080:http" \
io.openshift.expose-services="8443:https" \
io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \
com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \
name="rhel8/${NAME}-${NGINX_SHORT_VER}" \
version="1" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
help="For more information visit https://github.com/sclorg/${NAME}-container" \
usage="s2i build <SOURCE-REPOSITORY> rhel8/${NAME}-${NGINX_SHORT_VER}:latest <APP-NAME>"

ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
NGINX_CONF_PATH=/etc/nginx/nginx.conf \
NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \
NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \
NGINX_APP_ROOT=${APP_ROOT} \
NGINX_LOG_PATH=/var/log/nginx

RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'yum -y module enable nginx:$NGINX_VERSION && INSTALL_PKGS=\"nss_wrapper bind-utils gettext hostname nginx\" && yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && yum clean all'

# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
COPY ./s2i/bin/ $STI_SCRIPTS_PATH

# Copy extra files to the image.
COPY ./root/ /

# In order to drop the root user, we have to make some directories world
# writeable as OpenShift default security model is to run the container under
# random UID.
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'sed -i -f ${NGINX_APP_ROOT}/nginxconf-fed.sed ${NGINX_CONF_PATH} && chmod a+rwx ${NGINX_CONF_PATH} && mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && mkdir -p ${NGINX_LOG_PATH} && chmod -R a+rwx ${NGINX_APP_ROOT}/etc && chmod -R a+rwx /var/lib/nginx && chmod -R a+rwx ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && chown -R 1001:0 ${NGINX_APP_ROOT} && chown -R 1001:0 /var/lib/nginx && chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && chmod -R a+rwx /var/run && chown -R 1001:0 /var/run && rpm-file-permissions'

USER 1001

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/usr/share/nginx/html"]
# VOLUME ["/var/log/nginx/"]

CMD $STI_SCRIPTS_PATH/usage
38 changes: 38 additions & 0 deletions tests/cstrans-df-run/0010-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#@follow_tag(registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:v1.19.10-202306161322.el8.g42c8e14)
FROM registry-proxy.engineering.redhat.com/rh-osbs/openshift-golang-builder:v1.19.10-202306161322.el8.g42c8e14 AS builder

COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
WORKDIR $REMOTE_SOURCE_DIR/app
USER root
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'dnf install -y --setopt=tsflags=nodocs git'
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'sed -i \'s/CGO_ENABLED=0 //;s/containers_image_openpgp/& strictfipsruntime/\' Makefile'
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'go mod vendor && GOEXPERIMENT=strictfipsruntime make build VERSION=${CI_CONTAINER_VERSION}'

#@follow_tag(registry.redhat.io/ubi8/podman)
FROM registry.redhat.io/ubi8/podman:8.8-14.1697647490

LABEL com.redhat.component="quay-builder-container"
LABEL name="quay/quay-builder-rhel8"
LABEL version=${CI_CONTAINER_VERSION}
LABEL io.k8s.display-name="Red Hat Quay - Builder"
LABEL io.k8s.description="Red Hat Quay image builder"
LABEL summary="Red Hat Quay image builder"
LABEL maintainer "hgovinda@redhat.com"

COPY --from=builder $REMOTE_SOURCE_DIR/app/bin/quay-builder /usr/local/bin/quay-builder
COPY --from=builder $REMOTE_SOURCE_DIR/app/buildpack/ssh-git.sh /ssh-git.sh
COPY --from=builder $REMOTE_SOURCE_DIR/app/entrypoint.sh /home/podman/entrypoint.sh

RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'set -ex\t; dnf install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False git wget \t; dnf -y update && dnf -y -q clean all'

# Rootless/unprivileged buildah configurations
# https://github.com/containers/buildah/blob/main/docs/tutorials/05-openshift-rootless-build.md
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' $'touch /etc/subgid /etc/subuid && chmod g=u /etc/subgid /etc/subuid /etc/passwd && echo \'podman:100000:65536\' > /etc/subuid && echo \'podman:100000:65536\' > /etc/subgid && \tmkdir -p /home/podman/.config/containers && (echo \'[storage]\';echo \'driver = \"vfs\"\') > /home/podman/.config/containers/storage.conf && sed -i \'s/short-name-mode=\"enforcing\"/short-name-mode=\"permissive\"/g\' /etc/containers/registries.conf && \tmkdir /certs /home/podman/.config/cni && chown podman:podman /certs /home/podman/.config/cni'

VOLUME ["/tmp", "/certs"]

WORKDIR /home/podman

USER podman

ENTRYPOINT ["sh", "/home/podman/entrypoint.sh"]
24 changes: 24 additions & 0 deletions tests/cstrans-df-run/0011-sf-stdout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Python cuda base #################################################################
FROM cuda-base AS python-cuda-base

ENV VIRTUAL_ENV=/opt/vllm
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# install cuda and common dependencies
RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,source=requirements-common.txt,target=requirements-common.txt --mount=type=bind,source=requirements-cuda.txt,target=requirements-cuda.txt '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'pip install -r requirements-cuda.txt'

## Development #################################################################
FROM python-cuda-base AS dev

# install build and runtime dependencies
RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,source=requirements-common.txt,target=requirements-common.txt --mount=type=bind,source=requirements-cuda.txt,target=requirements-cuda.txt --mount=type=bind,source=requirements-dev.txt,target=requirements-dev.txt --mount=type=bind,source=requirements-lint.txt,target=requirements-lint.txt --mount=type=bind,source=requirements-test.txt,target=requirements-test.txt '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'pip3 install -r requirements-cuda.txt -r requirements-dev.txt'

## Builder #####################################################################
FROM dev AS build

# install build dependencies
RUN --mount=type=cache,target=/root/.cache/pip --mount=type=bind,source=requirements-build.txt,target=requirements-build.txt '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'pip install -r requirements-build.txt'

# install compiler cache to speed up compilation leveraging local or remote caching
# git is required for the cutlass kernels
RUN '/opt/cov-sa-2019.09/bin/cov-build' '--dir=/cov' '--append-log' 'sh' '-c' 'rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && rpm -ql epel-release && microdnf install -y git ccache && microdnf clean all'
14 changes: 11 additions & 3 deletions tests/cstrans-df-run/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,23 @@
# along with csdiff. If not, see <http://www.gnu.org/licenses/>.

# a generic template for cstrans-df-run tests
macro(test_cstrans_df_run tst)
macro(test_cstrans_df_run_core tst opt tag)
set(test_data_prefix "${CMAKE_CURRENT_SOURCE_DIR}/${tst}")
set(cmd "${CMAKE_BINARY_DIR}/src/cstrans-df-run")
set(cmd "${cmd} -- /opt/cov-sa-2019.09/bin/cov-build --dir=/cov --append-log")
set(cmd "${cmd} ${opt} -- /opt/cov-sa-2019.09/bin/cov-build --dir=/cov --append-log")
set(cmd "${cmd} <${test_data_prefix}-stdin.txt")
set(cmd "${cmd} | ${diffcmd} ${test_data_prefix}-stdout.txt -")
set(cmd "${cmd} | ${diffcmd} ${test_data_prefix}${tag}-stdout.txt -")
add_test_wrap("cstrans-df-run-${tst}" "${cmd}")
endmacro()

macro(test_cstrans_df_run tst)
# add default test using exec form
test_cstrans_df_run_core(${tst} "" "")

# add another test using shell form
test_cstrans_df_run_core(${tst} "--shell-form" "-sf")
endmacro()

# cstrans-df-run tests
test_cstrans_df_run(0001)
test_cstrans_df_run(0002)
Expand Down
Loading

0 comments on commit b05206d

Please sign in to comment.