Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DP3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mattia Mancini
DP3
Commits
c53df518
Commit
c53df518
authored
1 year ago
by
Maik Nijhuis
Browse files
Options
Downloads
Patches
Plain Diff
AST-1460
Enable make wheels
parent
866c5498
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+75
-1
75 additions, 1 deletion
.gitlab-ci.yml
docker/make_wheels.sh
+22
-13
22 additions, 13 deletions
docker/make_wheels.sh
docker/py310_wheel.docker
+1
-1
1 addition, 1 deletion
docker/py310_wheel.docker
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
99 additions
and
16 deletions
.gitlab-ci.yml
+
75
−
1
View file @
c53df518
...
...
@@ -191,6 +191,52 @@ build-package-2204:
-
if
:
'
$CI_COMMIT_TAG'
-
if
:
'
$UPLOAD_PACKAGE'
.build-wheel
:
stage
:
build
needs
:
[]
image
:
docker:20.10
services
:
-
docker:20.10-dind
tags
:
-
das6
before_script
:
-
apk add bash
script
:
-
cd docker
-
USER=root ./make_wheels.sh $PYTHON_VERSION
artifacts
:
paths
:
-
output-*/*
rules
:
-
<<
:
*if_astron_repo
when
:
manual
allow_failure
:
true
build-wheel-36
:
extends
:
.build-wheel
variables
:
PYTHON_VERSION
:
36
build-wheel-37
:
extends
:
.build-wheel
variables
:
PYTHON_VERSION
:
37
build-wheel-38
:
extends
:
.build-wheel
variables
:
PYTHON_VERSION
:
38
build-wheel-39
:
extends
:
.build-wheel
variables
:
PYTHON_VERSION
:
39
build-wheel-310
:
extends
:
.build-wheel
variables
:
PYTHON_VERSION
:
310
linting-2204
:
stage
:
linting
extends
:
[
"
.failable"
,
"
.needs-base-2204"
]
...
...
@@ -359,6 +405,35 @@ deploy-package-2204:
when
:
never
-
if
:
'
$UPLOAD_PACKAGE'
.deploy-wheel
:
stage
:
publish
image
:
python:latest
script
:
-
pip install twine
-
TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi output-*/*.whl
when
:
manual
allow_failure
:
true
deploy-wheel-36
:
extends
:
.deploy-wheel
needs
:
[
"
build-wheel-36"
]
deploy-wheel-37
:
extends
:
.deploy-wheel
needs
:
[
"
build-wheel-37"
]
deploy-wheel-38
:
extends
:
.deploy-wheel
needs
:
[
"
build-wheel-38"
]
deploy-wheel-39
:
extends
:
.deploy-wheel
needs
:
[
"
build-wheel-39"
]
deploy-wheel-310
:
extends
:
.deploy-wheel
needs
:
[
"
build-wheel-310"
]
pages-2204
:
stage
:
pages
needs
:
[
"
versioning"
,
"
build-debug-2204"
,
"
unit-test-2204"
,
"
integration-test-2204"
]
...
...
@@ -385,6 +460,5 @@ pages-2204:
coverage_report
:
coverage_format
:
cobertura
path
:
public/build/reports/code-coverage.xml
rules
:
-
<<
:
*if_not_astron_repo
This diff is collapsed.
Click to expand it.
docker/make_wheels.sh
+
22
−
13
View file @
c53df518
#!/
usr/
bin/bash
#!/bin/bash
# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
# SPDX-License-Identifier: GPL-3.0-or-later
# Script to make python wheels for several versions
# The working directory matters, script should be run with ./make_wheels.sh
# The parent directory should contain the source code with the version to build.
# Script that makes python wheels for several versions.
# The working directory matters since the parent directory should contain the
# source code. The script should be run with
# ./make_wheels.sh <python versions>
# For example, when <python versions> equals 38 310, the script builds wheels
# for python 3.8 and 3.10.
# If <python versions> is empty, it becomes: 310 39 38 37 36 .
set
-euo
pipefail
for
py_version
in
310 39 38 37 36
;
do
for
py_version
in
${
@
:-
310
39 38 37 36
}
;
do
pushd
..
sed
-i
"s=
\(
master_wheel
\)
[0-9]*=
\1
${
py_version
}
="
docker/py310_wheel.docker
grep
wheel3 docker/py310_wheel.docker
# Use the Python3.10 dockerfile as a template, even for Python3.10.
dockerfile
=
$(
mktemp
make_wheels.docker.XXXXXX
)
cat
docker/py310_wheel.docker
>
$dockerfile
sed
-i
"s=
\(
casacore:master_wheel
\)
310=
\1
${
py_version
}
="
$dockerfile
## Build docker image from docker-file. The current wheel is created there
#
docker build -t dp3-py${py_version}-$USER -f docker
/py310_wheel.docker
.
docker build
-t
dp3-py
${
py_version
}
-
$USER
-f
$
docker
file
.
## Create a docker container from that image, and extract the wheel
#containerid=$(docker create dp3-py${py_version}-$USER)
#echo "Docker container ID is: $containerid"
#docker cp $containerid:/output/ output-${py_version} # Copies whole dir
#docker rm ${containerid}
#docker image rm dp3-py${py_version}-$USER
containerid
=
$(
docker create dp3-py
${
py_version
}
-
$USER
)
echo
"Docker container ID is:
$containerid
"
docker
cp
$containerid
:/output/ output-
${
py_version
}
# Copies whole dir
docker
rm
${
containerid
}
docker image
rm
dp3-py
${
py_version
}
-
$USER
rm
$dockerfile
popd
done
This diff is collapsed.
Click to expand it.
docker/py310_wheel.docker
+
1
−
1
View file @
c53df518
...
...
@@ -50,6 +50,6 @@ RUN sed -i '/find_package(PythonLibs 3 REQUIRED)/d' CMakeLists.txt
# and to remove the previous wheel when changing parameters that causes a new
# wheel filename e.g. changing the version number.
RUN
/opt/python/
${
TARGET
}
/bin/python ./setup.py build_ext
-j
${
THREADS
}
RUN
mv
/dp3/build/temp.linux-x86_64-
cpython-39
/dp3/DP3 /dp3/build/
temp.linux-x86_64-cpython-39/dp3/
__DP3_from_pip__
RUN
mv
/dp3/build/temp.linux-x86_64-
*
/dp3/DP3 /dp3/build/__DP3_from_pip__
RUN
/opt/python/
${
TARGET
}
/bin/python ./setup.py bdist_wheel
-d
.
RUN
auditwheel repair
--plat
manylinux2014_x86_64
-w
/output
*
.whl
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
c53df518
...
...
@@ -130,7 +130,7 @@ setup(
# LD_PRELOAD=/path/to/lib/libpython3.9.so __DP3_from_pip__
(
"
bin
"
,
[
"
/dp3/build/temp.linux-x86_64-cpython-39/dp3
/__DP3_from_pip__
"
],
[
"
build
/__DP3_from_pip__
"
],
),
],
url
=
"
https://dp3.readthedocs.io/
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment