Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
heptapod-docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
heptapod-docker
Commits
7914baa4
Commit
7914baa4
authored
4 years ago
by
Georges Racinet
Browse files
Options
Downloads
Patches
Plain Diff
build-launch: removed all build capability
The builds now happen entirely in Heptapod CI/CD
parent
98527213
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
heptapod-dev/build-launch
+3
-66
3 additions, 66 deletions
heptapod-dev/build-launch
with
3 additions
and
66 deletions
heptapod-dev/build-launch
+
3
−
66
View file @
7914baa4
...
...
@@ -197,26 +197,8 @@
`full_tag` is actually the full name of the image, with the tag part.
Examples: `octobus/heptapod:testing`
"""
with
open
(
os
.
path
.
join
(
context_dir
,
'
heptapod_revisions.json
'
))
as
jsonf
:
revisions
=
json
.
load
(
jsonf
)
prepare_sources
(
context_dir
,
revisions
,
shares_dir
,
simulate
=
simulate
)
py_version_tag
=
py_version_image_tag
(
full_tag
,
py_version
)
cmd
=
[
'
docker
'
,
'
build
'
,
'
-t
'
,
py_version_tag
]
if
no_cache
:
cmd
.
extend
((
'
--pull
'
,
'
--no-cache
'
))
if
squash
:
cmd
.
append
(
'
--squash
'
)
cmd
.
extend
(
docker_build_args
(
py_version
))
cmd
.
append
(
context_dir
)
print
(
"
%s: %r
"
%
(
msg
,
cmd
))
if
not
simulate
:
subprocess
.
check_call
(
cmd
)
if
py_version
==
DEFAULT_PYTHON_VERSION
:
cmd
=
(
'
docker
'
,
'
tag
'
,
py_version_tag
,
full_tag
)
print
(
"
%s: %r
"
%
(
msg
,
cmd
))
if
not
simulate
:
subprocess
.
check_call
(
cmd
)
print
()
raise
NotImplementedError
(
"
As of Heptapod 0.17.0, local building does
"
"
not make sense any more
"
)
def
retag_partial_image
(
full_tag
,
...
...
@@ -307,14 +289,9 @@
run_group
.
add_argument
(
'
--container-name
'
,
default
=
'
heptapod
'
)
img_group
=
parser
.
add_argument_group
(
"
Docker image options
"
)
img_group
.
add_argument
(
'
--no-build
'
,
action
=
'
store_true
'
,
help
=
"
Don
'
t build any image. This has precedence
"
"
over --build-base-image. Together with
"
"
--image-tag, can be used, e.g, to test the
"
"
base %r image
"
%
BASE_IMAGE_TAG
)
img_group
.
add_argument
(
'
--no-cache
'
,
action
=
'
store_true
'
,
help
=
"
Build image(s) without cache.
"
)
img_group
.
add_argument
(
'
--image-tag
'
,
help
=
"
Tag for the produced and/or run image.
"
"
The default %r is suitable
"
"
for --push
"
%
DEFAULT_IMAGE_TAG
)
...
...
@@ -315,13 +292,9 @@
img_group
.
add_argument
(
'
--no-cache
'
,
action
=
'
store_true
'
,
help
=
"
Build image(s) without cache.
"
)
img_group
.
add_argument
(
'
--image-tag
'
,
help
=
"
Tag for the produced and/or run image.
"
"
The default %r is suitable
"
"
for --push
"
%
DEFAULT_IMAGE_TAG
)
img_group
.
add_argument
(
'
--build-base-image
'
,
action
=
"
store_true
"
,
help
=
"
Build or rebuild the base Heptapod image %r
"
"
upon which this
"
"
development image is based.
"
%
BASE_IMAGE_TAG
)
img_group
.
add_argument
(
'
--squash
'
,
action
=
"
store_true
"
,
help
=
"
If True and the base image is to be built,
"
"
use `docker build --squash` to build the base
"
...
...
@@ -341,9 +314,7 @@
log_vol
=
expand_join
(
parsed_args
.
volumes_dir
,
parsed_args
.
volume_logs
)
src_vol
=
os
.
path
.
expanduser
(
parsed_args
.
volume_src
)
do_build_dev
=
not
parsed_args
.
no_build
and
not
parsed_args
.
base
do_build_base
=
not
parsed_args
.
no_build
and
(
parsed_args
.
build_base_image
or
parsed_args
.
base
)
do_build_dev
=
do_build_base
=
False
do_push
=
parsed_args
.
push
do_run
=
not
parsed_args
.
no_run
...
...
@@ -381,40 +352,6 @@
shares_dir
=
parsed_args
.
src_shares_dir
if
do_build_base
:
if
py_version
==
'
3
'
:
retag_partial_image
(
BASE_IMAGE_TAG
,
pull
=
no_cache
,
simulate
=
simulate
)
else
:
build_image
(
BASE_IMAGE_TAG
,
os
.
path
.
join
(
OMNIBUS_DIR
,
'
heptapod
'
),
no_cache
=
no_cache
,
shares_dir
=
shares_dir
,
squash
=
bool
(
parsed_args
.
squash
),
py_version
=
py_version
,
simulate
=
simulate
,
msg
=
"
Docker base image build command
"
)
if
do_push
:
push_image
(
py_version_tag
,
simulate
=
simulate
)
if
py_version
==
DEFAULT_PYTHON_VERSION
:
push_image
(
BASE_IMAGE_TAG
,
simulate
=
simulate
)
if
do_build_dev
:
if
py_version
!=
DEFAULT_PYTHON_VERSION
:
sys
.
stderr
.
write
(
"
Sorry, building dev image is available only
"
"
for the default --python-version=%r at the
"
"
time being
\n
"
%
DEFAULT_PYTHON_VERSION
)
sys
.
exit
(
1
)
build_image
(
image_tag
,
DOCKER_CONTEXT_DIR
,
shares_dir
=
shares_dir
,
simulate
=
simulate
,
py_version
=
py_version
,
no_cache
=
no_cache
)
if
do_push
:
push_image
(
image_tag
,
py_version
,
simulate
=
simulate
)
if
not
do_run
:
return
...
...
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