Skip to content

Commit

Permalink
Updates the CI settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Hirotaka Wakabayashi committed Oct 2, 2023
1 parent bea3940 commit e295335
Show file tree
Hide file tree
Showing 10 changed files with 1,333 additions and 1,059 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ case "${OS_NAME}-${OS_VERSION}" in
DEBIAN_FRONTEND="noninteractive" sudo apt-get update -y
DEBIAN_FRONTEND="noninteractive" sudo apt-get install -y curl pylint
curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.deb.sh | sudo bash
DEBIAN_FRONTEND="noninteractive" sudo apt-get install -y k2hdkc-dev
;;
centos-7)
sudo yum install -y epel-release-7
sudo yum install -y --enablerepo=epel pylint python3 git curl which
curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.rpm.sh | sudo bash
sudo yum install -y k2hdkc-devel
;;
centos-8|fedora*)
sudo dnf install -y epel-release-8
sudo dnf install -y python3-pylint git curl
curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.rpm.sh | sudo bash
sudo dnf install -y k2hdkc-devel
;;
esac

cd cluster
sh start_server.sh
sh ./cluster/start_server.sh

exit $?

Expand Down
4 changes: 1 addition & 3 deletions .github/scripts/lint_with_pylint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ else
fi

echo "[OK] HOSTNAME=${HOSTNAME} OS_NAME=${OS_NAME} OS_VERSION=${OS_VERSION}"
cd src

pylint k2hdkc --py3k -r n
pylint src/k2hdkc

exit $?

Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# CREATE: Tue Feb 08 2022
# REVISION:
#
#
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

Expand All @@ -32,25 +31,33 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.x", "3.10", "3.9", "3.8", "3.7"]

python-version: ["3.11", "3.10", "3.9", "3.8"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Install dependencies
run: |
./.github/scripts/install_dependencies.sh
shell: sh
- name: Install dependencies in GHA
run: |
python -m pip install --upgrade pip
pip install pylint pytest
- name: Lint with pylint
run: |
./.github/scripts/lint_with_pylint.sh
shell: sh
- name: Test with unittest
run: |
./.github/scripts/test_with_unittest.sh
python -I -m pip install 'setuptools>=42' wheel
pip install -q build
python -m build
pip3 install dist/k2hdkc-*.whl
pytest
shell: sh
- name: Install dependencies for upload pypi package
if: startsWith(github.ref, 'refs/tags')
Expand All @@ -61,7 +68,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
run: python -m build
- name: Publish distribution to PyPI
if: ${{ matrix.python-version == '3.x' && startsWith(github.ref, 'refs/tags') }}
if: ${{ matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags') }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
37 changes: 27 additions & 10 deletions cluster/start_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,25 @@ LOGLEVEL=info
# Starts chmpx and k2hdkc
#
start_process() {
echo "chmpx -conf ${SRCDIR}/server.yaml -d ${LOGLEVEL} > ${SRCDIR}/chmpx.log 2>&1"
nohup chmpx -conf ${SRCDIR}/server.yaml -d ${LOGLEVEL} > ${SRCDIR}/chmpx.log 2>&1 &
if ! test -f "/tmp/server.yaml"; then
echo "cp ${SRCDIR}/server.yaml /tmp/"
cp ${SRCDIR}/server.yaml /tmp
fi
if ! test -f "/tmp/slave.yaml"; then
echo "cp ${SRCDIR}/slave.yaml /tmp/"
cp ${SRCDIR}/slave.yaml /tmp
fi

echo "chmpx -conf /tmp/server.yaml -d ${LOGLEVEL} > /tmp/chmpx.log 2>&1"
nohup chmpx -conf /tmp/server.yaml -d ${LOGLEVEL} > /tmp/chmpx.log 2>&1 &
echo "sleep 3"
sleep 3
echo "k2hdkc -conf ${SRCDIR}/server.yaml -d ${LOGLEVEL} > ${SRCDIR}/k2hdkc.log 2>&1"
nohup k2hdkc -conf ${SRCDIR}/server.yaml -d ${LOGLEVEL} > ${SRCDIR}/k2hdkc.log 2>&1 &
echo "k2hdkc -conf /tmp/server.yaml -d ${LOGLEVEL} > /tmp/k2hdkc.log 2>&1"
nohup k2hdkc -conf /tmp/server.yaml -d ${LOGLEVEL} > /tmp/k2hdkc.log 2>&1 &
echo "sleep 3"
sleep 3
echo "chmpx -conf ${SRCDIR}/slave.yaml -d ${LOGLEVEL} > ${SRCDIR}/slave.log 2>&1"
nohup chmpx -conf ${SRCDIR}/slave.yaml -d ${LOGLEVEL} > ${SRCDIR}/slave.log 2>&1 &
echo "chmpx -conf /tmp/slave.yaml -d ${LOGLEVEL} > /tmp/slave.log 2>&1"
nohup chmpx -conf /tmp/slave.yaml -d ${LOGLEVEL} > /tmp/slave.log 2>&1 &
echo "sleep 3"
sleep 3
}
Expand All @@ -62,6 +71,14 @@ stop_process() {
pkill -9 -x ${PROC}
fi
done
if test -f "/tmp/server.yaml"; then
echo "rm -f /tmp/server.yaml"
rm -f /tmp/server.yaml
fi
if test -f "/tmp/slave.yaml"; then
echo "rm -f /tmp/slave.yaml"
rm -f /tmp/slave.yaml
fi
}

# Shows status of chmpx and k2hdkc
Expand Down Expand Up @@ -161,9 +178,9 @@ make_k2hash() {
elif test "${_os_name}" = "centos" -o "${_os_name}" = "rhel"; then
_configure_opt="--with-nss"
if test "${OS_VERSION}" = "7"; then
sudo yum install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig libyaml-devel nss-devel
sudo yum install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig libyaml-devel nss-devel
elif test "${OS_VERSION}" = "8"; then
sudo dnf install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig
sudo dnf install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig
sudo dnf install -y --enablerepo=powertools nss-devel libyaml-devel
fi
else
Expand Down Expand Up @@ -224,9 +241,9 @@ make_k2hdkc() {
elif test "${_os_name}" = "centos" -o "${_os_name}" = "rhel"; then
_configure_opt="--with-nss"
if test "${OS_VERSION}" = "7"; then
sudo yum install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig libyaml-devel nss-devel
sudo yum install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig libyaml-devel nss-devel
elif test "${OS_VERSION}" = "8"; then
sudo dnf install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig
sudo dnf install -y git curl autoconf automake gcc gcc-c++ gdb make libtool pkgconfig
sudo dnf install -y --enablerepo=powertools nss-devel libyaml-devel
fi
else
Expand Down
Loading

0 comments on commit e295335

Please sign in to comment.