Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
b8009222
Commit
b8009222
authored
5 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Improve the bob release instructions
parent
11b85512
No related branches found
No related tags found
1 merge request
!145
Improve the release scripts
Pipeline
#37453
passed
5 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/devtools/scripts/release.py
+0
-6
0 additions, 6 deletions
bob/devtools/scripts/release.py
bob/devtools/scripts/update_bob.py
+21
-10
21 additions, 10 deletions
bob/devtools/scripts/update_bob.py
doc/release.rst
+36
-34
36 additions, 34 deletions
doc/release.rst
with
57 additions
and
50 deletions
bob/devtools/scripts/release.py
+
0
−
6
View file @
b8009222
...
@@ -143,12 +143,6 @@ def release(changelog, group, package, resume, dry_run):
...
@@ -143,12 +143,6 @@ def release(changelog, group, package, resume, dry_run):
gl
=
get_gitlab_instance
()
gl
=
get_gitlab_instance
()
# if we are releasing 'bob' metapackage, it's a simple thing, no GitLab
# API
if
package
==
"
bob
"
:
release_bob
(
changelog
)
return
# traverse all packages in the changelog, edit older tags with updated
# traverse all packages in the changelog, edit older tags with updated
# comments, tag them with a suggested version, then try to release, and
# comments, tag them with a suggested version, then try to release, and
# wait until done to proceed to the next package
# wait until done to proceed to the next package
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/update_bob.py
+
21
−
10
View file @
b8009222
...
@@ -12,21 +12,23 @@ logger = get_logger(__name__)
...
@@ -12,21 +12,23 @@ logger = get_logger(__name__)
@click.command
(
@click.command
(
epilog
=
"""
epilog
=
"""
\b
Examples:
Examples:
bdt gitlab update-bob -vv
bdt gitlab update-bob -vv
bdt gitlab update-bob -vv
--stable
"""
"""
)
)
@ref_option
()
@click.option
(
"
--stable/--beta
"
,
help
=
"
To use the stable versions in the list and pin packages.
"
)
@verbosity_option
()
@verbosity_option
()
@bdt.raise_on_error
@bdt.raise_on_error
def
update_bob
(
ref
):
def
update_bob
(
stable
):
"""
Updates the Bob meta package with new packages.
"""
Updates the Bob meta package with new packages.
"""
"""
import
tempfile
import
tempfile
from
..ci
import
read_packages
from
..ci
import
read_packages
from
..release
import
get_gitlab_instance
,
download_path
from
..release
import
get_gitlab_instance
,
download_path
,
get_latest_tag_name
gl
=
get_gitlab_instance
()
gl
=
get_gitlab_instance
()
...
@@ -34,7 +36,7 @@ def update_bob(ref):
...
@@ -34,7 +36,7 @@ def update_bob(ref):
nightlies
=
gl
.
projects
.
get
(
"
bob/bob.nightlies
"
)
nightlies
=
gl
.
projects
.
get
(
"
bob/bob.nightlies
"
)
with
tempfile
.
NamedTemporaryFile
()
as
f
:
with
tempfile
.
NamedTemporaryFile
()
as
f
:
download_path
(
nightlies
,
"
order.txt
"
,
f
.
name
,
ref
=
ref
)
download_path
(
nightlies
,
"
order.txt
"
,
f
.
name
,
ref
=
"
master
"
)
packages
=
read_packages
(
f
.
name
)
packages
=
read_packages
(
f
.
name
)
# find the list of public packages
# find the list of public packages
...
@@ -60,13 +62,22 @@ def update_bob(ref):
...
@@ -60,13 +62,22 @@ def update_bob(ref):
"
The following packages were not public:
\n
%s
"
,
"
\n
"
.
join
(
private_packages
)
"
The following packages were not public:
\n
%s
"
,
"
\n
"
.
join
(
private_packages
)
)
)
# modify conda/meta.yaml and requirements.txt in bob/bob
# if requires stable versions, add latest tag versions to the names
if
stable
:
logger
.
info
(
"
Getting latest tag names for the public packages
"
)
tags
=
[
get_latest_tag_name
(
gl
.
projects
.
get
(
f
"
bob/
{
pkg
}
"
))
for
pkg
in
public_packages
]
public_packages
=
[
f
"
{
pkg
}
==
{
tag
}
"
for
pkg
,
tag
in
zip
(
public_packages
,
tags
)]
# modify conda/meta.yaml and requirements.txt in bob/bob
logger
.
info
(
"
Updating conda/meta.yaml
"
)
logger
.
info
(
"
Updating conda/meta.yaml
"
)
start_tag
=
"
# LIST OF BOB PACKAGES - START
"
start_tag
=
"
# LIST OF BOB PACKAGES - START
"
end_tag
=
"
# LIST OF BOB PACKAGES - END
"
end_tag
=
"
# LIST OF BOB PACKAGES - END
"
with
open
(
"
conda/meta.yaml
"
,
"
r+
"
)
as
f
:
with
open
(
"
conda/meta.yaml
"
)
as
f
:
lines
=
f
.
read
()
lines
=
f
.
read
()
i1
=
lines
.
find
(
start_tag
)
+
len
(
start_tag
)
i1
=
lines
.
find
(
start_tag
)
+
len
(
start_tag
)
i2
=
lines
.
find
(
end_tag
)
i2
=
lines
.
find
(
end_tag
)
...
@@ -75,7 +86,7 @@ def update_bob(ref):
...
@@ -75,7 +86,7 @@ def update_bob(ref):
lines
[:
i1
]
+
"
\n
-
"
.
join
([
""
]
+
public_packages
)
+
"
\n
"
+
lines
[
i2
:]
lines
[:
i1
]
+
"
\n
-
"
.
join
([
""
]
+
public_packages
)
+
"
\n
"
+
lines
[
i2
:]
)
)
f
.
seek
(
0
)
with
open
(
"
conda/meta.yaml
"
,
"
w
"
)
as
f
:
f
.
write
(
lines
)
f
.
write
(
lines
)
logger
.
info
(
"
Updating requirements.txt
"
)
logger
.
info
(
"
Updating requirements.txt
"
)
...
...
This diff is collapsed.
Click to expand it.
doc/release.rst
+
36
−
34
View file @
b8009222
...
@@ -69,67 +69,69 @@ To manually update the changelog, follow these guidelines:
...
@@ -69,67 +69,69 @@ To manually update the changelog, follow these guidelines:
Releasing the Bob meta package
Releasing the Bob meta package
==============================
==============================
.. todo:: These instructions may be outdated!!
Here are the instructions to release Bob meta package:
Here are the instructions to release Bob meta package:
* Run:
* Run:
.. code-block:: sh
.. code-block:: sh
$
bdt gitlab getpath bob/bob.nightlies order.txt
$
cd bob
$ bdt gitlab
visibility order.txt
$ bdt gitlab
update-bob -vvv --stable
* Put the list of public packages in ../../bob/requirements.txt
* The script above cannot identify linux only packages. After running the script,
* Run ``bdt gitlab changelog`` first:
**you need to manually tag linux only packages** in both ``conda/meta.yaml`` and
``requirements.txt``. For example, in ``conda/meta.yaml``::
.. code-block::
sh
.. code-block::
yaml
$ bdt gitlab changelog ../../bob/requirements.txt bob_changelog.md
- bob.ip.binseg ==1.1.0 # [linux]
* Put the beta of version of the intended release version in
and, in ``requirements.txt``::
``../../bob/version.txt``
* For example do ``$ echo 5.0.0b0 > version.txt`` for bob 5.0.0 release.
bob.ip.binseg ==1.1.0 ; sys_platform == 'linux'
* Commit only this change to master: ``$ git commit -m "prepare for bob 5 release" version.txt``
* Get the pinnings (``--bob-version`` needs to be changed):
* Test the conda recipe of bob. You may want to cancel the
command below once it reaches the nosetests.:
.. code-block:: sh
.. code-block:: sh
$ bdt
gitlab release -p bob -c bob_changelog.md --bob-version 5.0.0 -- TOKEN
$ bdt
build -vv --stable
* Put the pinnings below in requirements.txt and meta.yaml (like ``bob.buildout
* Commit the changes and push:
== 2.1.6``) and meta.yaml (like ``bob.buildout 2.1.6``)
* Make sure you add `` # [linux]`` to Linux only packages.
.. code-block:: sh
$ git commit -m "Pinning packages for the next release. [skip ci]" conda/meta.yaml requirements.txt
$ git push
* Test the conda recipe:
* Tag the package using the same changelog mechanism that you used to tag other
packages. Assuming the changelog has a ``* bob/bob`` entry:
.. code-block:: sh
.. code-block:: sh
$ cd ../../bob
$ bdt gitlab release -vvv CHANGELOG --package bob/bob
$ conda render -m ../bob.admin/gitlab/conda_build_config.yaml -c https://www.idiap.ch/software/bob/conda conda
* When the script says ``Waiting for the pipeline *** of "bob/bob" to finish``, cancel
it. You can check the progress online.
* Update the badges and version.txt to point to this version of Bob.
* To revert the pins while in beta run::
* Commit, push and tag a new version manually:
.. code-block:: sh
.. code-block:: sh
$ git commit -am "Increased stable version to 4.0.0"
$ git pull --rebase
$ git tag v4.0.0
$ bdt gitlab update-bob -vvv --beta
$ git push
$ git push --tags
* Put ``bob_changelog.md`` inside bob's tag description.
* Like before, **tag the linux only packages manually**.
* Cancel the pipeline for master and make sure that tag pipeline passes before
continuing.
* Commit and push the changes:
* Remove pinnings from bob's requirement.txt and meta.yaml and revert changes
that went in ``README.rst`` back to master version.
* Commit and push the following (not verbatim):
.. code-block:: sh
.. code-block:: sh
$ echo 4.0.1b0 > version.txt
$ git commit -m "Remove package pins while in beta. [skip ci]" conda/meta.yaml requirements.txt
$ git commit -am "Increased latest version to 4.0.1b0 [skip ci]"
$ git push
$ git push
You can see that if we could identify linux only packages automatically, the whole
release process would have been only to run
``bdt gitlab release -vvv CHANGELOG --package bob/bob``.
Do you want to help fix that?
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