Skip to content

Commit

Permalink
add makefile target to nicely print image hashes etc (#1517)
Browse files Browse the repository at this point in the history
* add makefile target to nicely print image hashes etc

* fix pyinstaller

* bump pyinstaller version

* fix CI pyinstaller (hopefully ..)
  • Loading branch information
oberstet authored Jan 29, 2022
1 parent dc62694 commit 54a8491
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ jobs:
python-version: '3.x'
architecture: 'x64'

# curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# python3 get-pip.py "pip<20"
# => fails with https://github.com/pypa/setuptools/issues/3044
- name: Install Python package dependencies
run: |
curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py "pip<20"
pip3 -U pip
pip3 show pip
pip3 install -r requirements-dev.txt
Expand Down
74 changes: 74 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ clean_wheels:
rm -rf ./.wheels
mkdir -p ./.wheels/

clean_docker:
-docker images | grep "crossbario/autobahn-python" | awk '{print $1}' | xargs docker rmi


download_wheels:
mkdir -p ./.wheels/
rm -f ./.wheels/*.whl
Expand All @@ -63,40 +67,64 @@ docker_stop_rm:
-docker rm $(docker ps -a -q -f)


show:
@echo
@echo
@echo "autobahn build configuration -------------------------------------------------------------------------------------------"
@echo
@echo " AUTOBAHN_BUILD_DATE = ${AUTOBAHN_BUILD_DATE}"
@echo " AUTOBAHN_BUILD_ID = ${AUTOBAHN_BUILD_ID}"
@echo " AUTOBAHN_VCS_REF = ${AUTOBAHN_VCS_REF}"
@echo " AUTOBAHN_VERSION = ${AUTOBAHN_VERSION}"
@echo ""
@echo " XBRNETWORK_EXE_FILENAME = ${XBRNETWORK_EXE_FILENAME}"
@echo


build: build_cpy build_pypy

test: test_cpy test_pypy

publish: publish_cpy publish_pypy

list: list_cpy list_pypy


build_amd64: build_cpy_amd64 build_pypy_amd64

test_amd64: test_cpy_amd64 test_pypy_amd64

publish_amd64: publish_cpy_amd64 publish_pypy_amd64

list_amd64: list_cpy_amd64 list_pypy_amd64


build_arm64v8: build_cpy_arm64v8 build_pypy_arm64v8

test_arm64v8: test_cpy_arm64v8 test_pypy_arm64v8

publish_arm64v8: publish_cpy_arm64v8 publish_pypy_arm64v8

list_arm64v8: list_cpy_arm64v8 list_pypy_arm64v8


build_cpy: build_cpy_amd64 build_cpy_arm64v8

test_cpy: test_cpy_amd64 test_cpy_arm64v8

publish_cpy: publish_cpy_amd64 publish_cpy_arm64v8

list_cpy: list_cpy_amd64 list_cpy_arm64v8


build_pypy: build_pypy_amd64 build_pypy_arm64v8

test_pypy: test_pypy_amd64 test_pypy_arm64v8

publish_pypy: publish_pypy_amd64 publish_pypy_arm64v8

list_pypy: list_pypy_amd64 list_pypy_arm64v8


build_cpy_amd64:
docker build \
Expand All @@ -119,6 +147,17 @@ publish_cpy_amd64:
docker push crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}
docker push crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}

list_cpy_amd64:
@echo
@echo "autobahn-python:cpy-amd64 ----------------------------------------------------------------------------------------------"
@echo
@docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@echo
@docker images crossbario/autobahn-python:cpy-amd64
@docker images crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}
@docker images crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@docker images `docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:cpy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}`


build_cpy_arm64v8:
docker build \
Expand All @@ -141,6 +180,18 @@ publish_cpy_arm64v8:
docker push crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}
docker push crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}

list_cpy_arm64v8:
@echo
@echo
@echo "autobahn-python:cpy-arm64v8 --------------------------------------------------------------------------------------------"
@echo
@docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@echo
@docker images crossbario/autobahn-python:cpy-arm64v8
@docker images crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}
@docker images crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@docker images `docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:cpy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}`


build_pypy_amd64:
docker build \
Expand All @@ -163,6 +214,18 @@ publish_pypy_amd64:
docker push crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}
docker push crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}

list_pypy_amd64:
@echo
@echo
@echo "autobahn-python:pypy-amd64 --------------------------------------------------------------------------------------------"
@echo
@docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@echo
@docker images crossbario/autobahn-python:pypy-amd64
@docker images crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}
@docker images crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@docker images `docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:pypy-amd64-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}`


build_pypy_arm64v8:
docker build \
Expand All @@ -185,6 +248,17 @@ publish_pypy_arm64v8:
docker push crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}
docker push crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}

list_pypy_arm64v8:
@echo
@echo
@echo "autobahn-python:pypy-arm64v8 ------------------------------------------------------------------------------------------"
@echo
@docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@echo
@docker images crossbario/autobahn-python:pypy-arm64v8
@docker images crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}
@docker images crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}
@docker images `docker inspect --format='{{index .RepoDigests 0}}' crossbario/autobahn-python:pypy-arm64v8-${AUTOBAHN_VERSION}-${AUTOBAHN_BUILD_ID}`

# Docker multi-arch manifest
#
Expand Down
15 changes: 15 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,18 @@ make build
make test
make publish
```


## Checking built images

To show the Docker image hashes and tags:

```
clear && make show list
```

To test the Docker images and print version infos:

```
clear && make test
```
13 changes: 10 additions & 3 deletions pyinstaller/xbrnetwork.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(['../autobahn/xbr/_cli.py'],
pathex=['/home/oberstet/scm/crossbario/autobahn-python/pyinstaller'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=['/home/oberstet/scm/crossbario/autobahn-python/pyinstaller'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
Expand All @@ -17,11 +19,12 @@ a = Analysis(['../autobahn/xbr/_cli.py'],
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)

exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
a.datas,
[],
name='xbrnetwork',
debug=False,
Expand All @@ -30,4 +33,8 @@ exe = EXE(pyz,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ passenv =
AUTOBAHN_VERSION
XBRNETWORK_EXE_FILENAME
deps =
pyinstaller==4.2
pip
pyinstaller==4.8
commands =
echo "Building with AUTOBAHN_BUILD_DATE={env:AUTOBAHN_BUILD_DATE}"
echo "Building with AUTOBAHN_BUILD_ID={env:AUTOBAHN_BUILD_ID}"
Expand All @@ -218,8 +219,9 @@ commands =
echo "Building with XBRNETWORK_EXE_FILENAME={env:XBRNETWORK_EXE_FILENAME}"

# Install pip v19.3.1 (yes, absolutely, we do not want the "new resolver" shit)
curl -sSL -o get-pip.py https://bootstrap.pypa.io/get-pip.py
python get-pip.py "pip<20"
# curl -sSL -o get-pip.py https://bootstrap.pypa.io/get-pip.py
# python get-pip.py # fails with https://github.com/pypa/setuptools/issues/3044
# python get-pip.py "pip<20"
pip show pip

# Install development dependencies
Expand Down

0 comments on commit 54a8491

Please sign in to comment.