-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from emc-isilon/modernize2
Modernize package and build infrastructure
- Loading branch information
Showing
67 changed files
with
389 additions
and
178 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
__pycache__ | ||
.coverage | ||
.coverage.* | ||
.idea | ||
.pytest_cache | ||
.tox | ||
|
||
*.pyc | ||
*.egg-info/ | ||
|
||
build | ||
dist | ||
doc/source/stubs | ||
wheelhouse |
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
name: Build and Publish Wheels | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build py3 wheels on ubuntu-22.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.11.3 | ||
- name: Build wheels | ||
run: ./samba/dc.sh ./build_and_test_wheels.sh | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_wheels_py27: | ||
name: Build py27 wheel on ubuntu-22.04 | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- name: Build wheels | ||
run: ./samba/dc.sh ./build_and_test_wheels27.sh | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build sdist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [build_wheels, build_wheels_py27, build_sdist] | ||
runs-on: ubuntu-latest | ||
# upload to PyPI on every tag starting with 'v' | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: ${{ secrets.PYPI_USERNAME }} | ||
password: ${{ secrets.PYPI_PASSWORD }} |
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 |
---|---|---|
@@ -1,5 +1,14 @@ | ||
__pycache__ | ||
.coverage | ||
.coverage.* | ||
.idea | ||
.pytest_cache | ||
.tox | ||
|
||
*.pyc | ||
*.egg-info/ | ||
|
||
build | ||
dist | ||
Pike.egg-info/ | ||
doc/source/stubs | ||
wheelhouse |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# blackify | ||
03f70b27c00a188790c40a0a59e4cbfce29b9719 | ||
e347aeb25405a29e43492c125e532c969aa6d6c7 | ||
# move to /src | ||
384b32c2436a974d8260b65c663567e669d5b2d5 |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
FROM quay.io/pypa/manylinux2010_x86_64 | ||
COPY . /src/pike | ||
RUN yum install -y krb5-devel krb5-workstation python27 && \ | ||
source /opt/rh/python27/enable && \ | ||
python2.7 -m pip install -U 'pip<21' && \ | ||
python2.7 -m pip install build | ||
|
||
CMD /src/pike/buildwheel/wheel27.sh |
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,8 @@ | ||
# buildwheel | ||
|
||
build pike-smb2 manylinux wheel (including for python2.7) | ||
|
||
``` | ||
docker build -t pike-buildwheel buildwheel | ||
docker run -it -v /tmp/wheelhouse:/src/pike/wheelhouse pike-buildwheel | ||
``` |
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
# source before bash "strict mode" | ||
source /opt/rh/python27/enable | ||
|
||
set -euxo pipefail | ||
|
||
# build py27 wheel | ||
cd /src/pike | ||
python2.7 -m build | ||
auditwheel repair dist/*.whl | ||
|
||
# Test the wheel | ||
export PIKE_SERVER=$SAMBA_SERVER | ||
export PIKE_SHARE=s1 | ||
|
||
./samba/krb5.conf.sh | ||
python2.7 -m pip install wheelhouse/*-cp27*.whl | ||
python2.7 -m unittest pike.test.session | ||
|
||
# if the wheelhouse dir is mounted, copy tested wheels to host | ||
[[ -d /wheelhouse ]] && cp wheelhouse/* /wheelhouse/ |
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 |
---|---|---|
@@ -1,5 +1,24 @@ | ||
[build-system] | ||
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm[toml]"] | ||
requires = ["setuptools>=44", "wheel", "setuptools_scm[toml]"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
|
||
[tool.cibuildwheel] | ||
# skip x86 pypi since pycryptodome packages | ||
# are broken on these playforms (at least py37) | ||
skip = ["pp*-manylinux_i686"] | ||
before-test = ["{project}/samba/krb5.conf.sh"] | ||
test-command = [ | ||
"export PIKE_SERVER=$SAMBA_SERVER", | ||
"export PIKE_SHARE=s1", | ||
"python -m unittest pike.test.session", | ||
] | ||
|
||
[tool.cibuildwheel.linux] | ||
environment-pass = ["HOST_IPV4", "SAMBA_REALM", "SAMBA_SERVER", "ADMIN_PASSWORD"] | ||
before-all = "yum install -y krb5-devel krb5-workstation" | ||
|
||
[[tool.cibuildwheel.overrides]] | ||
select = "*-musllinux*" | ||
before-all = "apk add krb5 krb5-dev" |
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,2 @@ | ||
s1 | ||
krb5.conf |
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,5 @@ | ||
FROM debian:11 | ||
|
||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive \ | ||
apt-get install -y krb5-user libkrb5-dev python2-dev python3-dev build-essential python3-pip git |
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,29 @@ | ||
# Samba DC environment | ||
|
||
This environment exists for running tests using kerberos authentication. | ||
|
||
## Requirements | ||
|
||
The host requires `docker compose` installed and functional. | ||
|
||
## Run All Tests | ||
|
||
Using kerberos authentication: | ||
|
||
```shell | ||
./samba/dc.sh docker compose up runner | ||
``` | ||
|
||
## Build Wheels | ||
|
||
Must run on linux; will use docker containers for the build. | ||
|
||
```shell | ||
pip install --user cibuildwheel | ||
./samba/dc.sh ./build_and_test_wheels.sh | ||
``` | ||
|
||
After each wheel is built, it will be installed and used to establish a kerberos | ||
session to the Samba DC. | ||
|
||
Built wheels will be placed in pike/wheelhouse. |
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 @@ | ||
Pik3IzC00lss |
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,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT=$(readlink -f "$0") | ||
SCRIPTPATH=$(dirname "$SCRIPT") | ||
cd $SCRIPTPATH/.. | ||
|
||
python3 -m cibuildwheel --platform linux "$@" |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT=$(readlink -f "$0") | ||
SCRIPTPATH=$(dirname "$SCRIPT") | ||
cd $SCRIPTPATH/.. | ||
|
||
docker build -t pike-buildwheel -f buildwheel/Dockerfile . | ||
docker run -e HOST_IPV4 -e SAMBA_REALM -e SAMBA_SERVER -e ADMIN_PASSWORD \ | ||
-v $SCRIPTPATH/../wheelhouse:/wheelhouse pike-buildwheel |
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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
SCRIPT=$(readlink -f "$0") | ||
SCRIPTPATH=$(dirname "$SCRIPT") | ||
|
||
IF=$(/sbin/ip route|awk '/default/ { print $5 }') | ||
export HOST_IPV4=$(ip -4 addr show $IF | grep -Po 'inet \K[\d.]+') | ||
export SAMBADC_INTERFACES=$IF | ||
export SAMBADC_HOSTNAME=dc | ||
export SAMBA_WORKGROUP=PIKE | ||
export SAMBA_REALM=${SAMBA_WORKGROUP}.TEST.LOCAL | ||
export SAMBA_SERVER=${SAMBADC_HOSTNAME}.${SAMBA_REALM} | ||
export ADMIN_PASSWORD=$(cat "$SCRIPTPATH/admin_password") | ||
|
||
function cleanup () | ||
{ | ||
docker compose down | ||
docker volume rm samba_lib samba_etc | ||
} | ||
|
||
trap cleanup EXIT | ||
cd "$SCRIPTPATH" | ||
docker compose up dc & | ||
sleep 30 | ||
# pass off control to remaining args | ||
"$@" |
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,54 @@ | ||
version: "3.1" | ||
|
||
services: | ||
runner: | ||
build: . | ||
environment: | ||
- HOST_IPV4 | ||
- SAMBA_REALM | ||
- SAMBA_SERVER | ||
- ADMIN_PASSWORD | ||
command: /src/pike/samba/run_all.sh | ||
volumes: | ||
- ${PWD}/..:/src/pike | ||
dc: | ||
image: ${REGISTRY_URI:-instantlinux}/samba-dc:latest | ||
restart: always | ||
network_mode: host | ||
cap_add: | ||
- CAP_SYS_ADMIN | ||
hostname: ${SAMBADC_HOSTNAME:-dc} | ||
environment: | ||
INTERFACES: ${SAMBADC_INTERFACES:-lo eth0} | ||
REALM: ${SAMBA_REALM:-pike.local} | ||
TZ: ${TZ:-UTC} | ||
WORKGROUP: ${SAMBA_WORKGROUP:-PIKE} | ||
volumes: | ||
- etc:/etc/samba | ||
- lib:/var/lib/samba | ||
- ${PWD}/share.conf:/etc/samba/conf.d/share.conf | ||
- ${PWD}/samba/s1:/srv/s1 | ||
ports: | ||
- 53:53 | ||
- 53:53/udp | ||
- 88:88 | ||
- 88:88/udp | ||
- 135:135 | ||
- 137-138:137-138/udp | ||
- 139:139 | ||
- 389:389 | ||
- 389:389/udp | ||
- 445:445 | ||
- 464:464 | ||
- 464:464/udp | ||
- 636:636 | ||
- 3268-3269:3268-3269 | ||
- 49152-65535 | ||
secrets: | ||
- samba-admin-password | ||
volumes: | ||
etc: | ||
lib: | ||
secrets: | ||
samba-admin-password: | ||
file: ${PWD}/admin_password |
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,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euxo pipefail | ||
|
||
cat - >> /etc/hosts <<EOF | ||
$HOST_IPV4 $SAMBA_REALM | ||
$HOST_IPV4 $SAMBA_SERVER | ||
EOF | ||
|
||
cat - > /etc/krb5.conf <<EOF | ||
[libdefaults] | ||
default_realm = $SAMBA_REALM | ||
[realms] | ||
$SAMBA_REALM = { | ||
kdc = $SAMBA_SERVER | ||
} | ||
EOF | ||
|
||
cat /etc/hosts /etc/krb5.conf | ||
|
||
printf "$ADMIN_PASSWORD\n" | kinit administrator |
Oops, something went wrong.