Skip to content
Open
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
8 changes: 7 additions & 1 deletion .github/scripts/dcperf_install_django.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ install_django () {
echo ""
fi

echo "[TEST] TODO: Implement This!"

# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing Django ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py install django_workload_default) || return 1
}
39 changes: 39 additions & 0 deletions .github/scripts/dcperf_install_health_check.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.


# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"


################################################################################
# Install Health Check
################################################################################

install_health_check () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install Health Check"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi

# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing Health Check ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py install health_check) || return 1
}
39 changes: 39 additions & 0 deletions .github/scripts/dcperf_install_spark.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.


# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"


################################################################################
# Install Spark
################################################################################

install_spark () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install Spark"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi

# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing Spark ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py install spark_standalone_remote) || return 1
}
40 changes: 40 additions & 0 deletions .github/scripts/dcperf_install_tao_bench.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.


# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"


################################################################################
# tao_bench Install Functions
################################################################################

install_tao_bench () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install Tao_bench"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi


# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing Tao_bench ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py install tao_bench_autoscale) || return 1
}
39 changes: 39 additions & 0 deletions .github/scripts/dcperf_install_video_transcode_bench.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.


# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"


################################################################################
# Install FeedSim
################################################################################

install_video_transcode_bench () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install VideoTranscodeBench"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi

# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")
clang --version
echo "[INSTALL] Installing VideoTranscodeBench ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py install video_transcode_bench_svt) || return 1
}
39 changes: 39 additions & 0 deletions .github/scripts/dcperf_install_wdl.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.


# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/utils_base.bash"


################################################################################
# Install wdl
################################################################################

install_wdl () {
local env_name="$1"
if [ "$env_name" == "" ]; then
echo "Usage: ${FUNCNAME[0]} ENV_NAME"
echo "Example(s):"
echo " ${FUNCNAME[0]} build_env"
return 1
else
echo "################################################################################"
echo "# Install wdl"
echo "#"
echo "# [$(date --utc +%FT%T.%3NZ)] + ${FUNCNAME[0]} ${*}"
echo "################################################################################"
echo ""
fi

# shellcheck disable=SC2155
local env_prefix=$(env_name_or_prefix "${env_name}")

echo "[INSTALL] Installing wdl ..."
(print_exec conda run --no-capture-output ${env_prefix} \
python ./benchpress_cli.py -b wdl install folly_single_core) || return 1
}
10 changes: 10 additions & 0 deletions .github/scripts/setup_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_django.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_feedsim.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_tao_bench.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_spark.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_video_transcode_bench.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_wdl.bash"
# shellcheck disable=SC1091,SC2128
. "$( dirname -- "$BASH_SOURCE"; )/dcperf_install_health_check.bash"
28 changes: 25 additions & 3 deletions .github/scripts/utils_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,38 @@ install_python_tools () {
# shellcheck disable=SC2086
(exec_with_retries 3 conda install ${env_prefix} -c conda-forge --override-channels -y \
click \
numpy \
numpy=1.* \
pandas \
pyyaml \
tabulate) || return 1
tabulate \
packaging) || return 1

# Check Python packages are importable
local import_tests=( click numpy pandas tabulate )
local import_tests=( click numpy pandas tabulate packaging )
for p in "${import_tests[@]}"; do
(test_python_import_package "${env_name}" "${p}") || return 1
done

echo "[INSTALL] Successfully installed all the build tools"
}

################################################################################
# HHVM Setup
################################################################################

install_hhvm (){
echo "[INSTALL] Installing hhvm ..."
if which dnf; then
wget https://github.com/facebookresearch/DCPerf/releases/download/hhvm/hhvm-3.30-multplatform-binary.tar.xz
tar -Jxf hhvm-3.30-multplatform-binary.tar.xz
else
wget https://github.com/facebookresearch/DCPerf/releases/download/hhvm/hhvm-3.30-multplatform-binary-ubuntu.tar.xz
tar -Jxf hhvm-3.30-multplatform-binary-ubuntu.tar.xz
apt-get update
apt-get install -y libpcre3 libunwind8

fi
cd hhvm || return 1
bash -x ./pour-hhvm.sh
cd .. || return 1
}
47 changes: 39 additions & 8 deletions .github/workflows/dcperf_ci_django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
name: DCPerf Django CI

on:
# PR Trigger
# PR Trigger — only run when files affecting this benchmark change
#
pull_request:
paths:
- 'packages/common/os-distro.sh'
- 'packages/django_workload/**'

# Push Trigger (enable to catch errors coming out of multiple merges)
#
push:
branches:
- main
paths:
- 'packages/common/os-distro.sh'
- 'packages/django_workload/**'

# Manual Trigger
#
Expand All @@ -31,7 +37,7 @@ jobs:
build_artifact:
runs-on: ${{ matrix.host-machine.instance }}
container:
image: ubuntu:22.04
image: ${{ matrix.host-machine.container }}
options: --user root --privileged --pid=host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand All @@ -41,18 +47,40 @@ jobs:
env:
PRELUDE: .github/scripts/setup_env.bash
BUILD_ENV: build_env
continue-on-error: true
continue-on-error: false
strategy:
fail-fast: false
matrix:
host-machine: [
{ arch: x86, instance: "ubuntu-latest" },
{ arch: x86, instance: "ubuntu-latest", container: "quay.io/centos/centos:stream9", type: "centos" },
{ arch: aarch64, instance: "ubuntu-24.04-arm", container: "quay.io/centos/centos:stream9", type: "centos" },
{ arch: x86, instance: "ubuntu-latest", container: "quay.io/centos/centos:stream10", type: "centos" },
{ arch: aarch64, instance: "ubuntu-24.04-arm", container: "quay.io/centos/centos:stream10", type: "centos" },
]
python-version: [ "3.12" ]

steps:
- name: Setup Build Container
run: apt update -y; apt install -y build-essential git pciutils socat sudo wget
- name: Setup Build Container (ubuntu-based)
if: ${{ matrix.host-machine.type == 'ubuntu' }}
run: apt update -y; apt install -y build-essential git pciutils socat sudo wget python3-dev

- name: Setup Build Container (centos-based)
if: ${{ matrix.host-machine.type == 'centos' }}
run: dnf update -y; dnf install -y git pciutils which python3-devel sudo shadow-utils passwd ; dnf group install -y "Development Tools" --exclude="texlive*"

- name: Fix PAM configuration for sudo
if: ${{ matrix.host-machine.type == 'centos' }}
run: |
echo "auth sufficient pam_rootok.so" > /etc/pam.d/sudo

- name: Enable Sudo without password
if: ${{ matrix.host-machine.type == 'centos' }}
run: |
echo "root ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers

- name: Unlock root user account
if: ${{ matrix.host-machine.type == 'centos' }}
run: |
passwd -u root

- name: Checkout the Repository
uses: actions/checkout@v4
Expand All @@ -65,14 +93,17 @@ jobs:
- name: Display System Info
run: . $PRELUDE; print_system_info

- name: Install Build Tools
run: . $PRELUDE; install_build_tools

- name: Setup Miniconda
run: . $PRELUDE; setup_miniconda $HOME/miniconda

- name: Create Conda Environment
run: . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }}

- name: Install Python Tools
run: . $PRELUDE; install_build_tools $BUILD_ENV
run: . $PRELUDE; install_python_tools $BUILD_ENV

- name: Install Django
run: . $PRELUDE; install_django $BUILD_ENV
Loading
Loading