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
c7e043f8
Commit
c7e043f8
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[scripts/ci] Be selective about packages we are supposed to cleanup at clean-betas action
parent
5e17870a
No related branches found
No related tags found
1 merge request
!100
More cleanup improvements
Pipeline
#32633
passed
5 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/devtools/ci.py
+17
-2
17 additions, 2 deletions
bob/devtools/ci.py
bob/devtools/dav.py
+11
-1
11 additions, 1 deletion
bob/devtools/dav.py
bob/devtools/scripts/ci.py
+7
-0
7 additions, 0 deletions
bob/devtools/scripts/ci.py
with
35 additions
and
3 deletions
bob/devtools/ci.py
+
17
−
2
View file @
c7e043f8
...
@@ -215,8 +215,23 @@ def select_user_condarc(paths, branch):
...
@@ -215,8 +215,23 @@ def select_user_condarc(paths, branch):
return
select_build_file
(
"
condarc
"
,
paths
,
branch
)
return
select_build_file
(
"
condarc
"
,
paths
,
branch
)
def
clean_betas
(
dry_run
,
username
,
password
):
def
clean_betas
(
dry_run
,
username
,
password
,
includes
):
"""
Cleans-up betas (through the CI). Executes if ``dry_run==False`` only.
"""
Cleans-up betas (through the CI). Executes if ``dry_run==False`` only.
Parameters:
dry_run (bool): If set, then does not execute any action, just print
what it would do instead.
username (str): The user to use for interacting with the WebDAV service
password (str): Password the the above user
includes (re.SRE_Pattern): A regular expression that matches the names
of packages that should be considered for clean-up. For example: for
Bob and BATL packages, you may use ``^(bob|batl|gridtk).*`` For BEAT
packages you may use ``^beat.*``
"""
"""
from
.deploy
import
_setup_webdav_client
from
.deploy
import
_setup_webdav_client
...
@@ -255,4 +270,4 @@ def clean_betas(dry_run, username, password):
...
@@ -255,4 +270,4 @@ def clean_betas(dry_run, username, password):
server_path
=
davclient
.
get_url
(
arch_path
)
server_path
=
davclient
.
get_url
(
arch_path
)
echo_info
(
'
Cleaning beta packages from %s
'
%
server_path
)
echo_info
(
'
Cleaning beta packages from %s
'
%
server_path
)
remove_old_beta_packages
(
client
=
davclient
,
path
=
arch_path
,
remove_old_beta_packages
(
client
=
davclient
,
path
=
arch_path
,
dry_run
=
dry_run
,
pyver
=
True
)
dry_run
=
dry_run
,
pyver
=
True
,
includes
=
includes
)
This diff is collapsed.
Click to expand it.
bob/devtools/dav.py
+
11
−
1
View file @
c7e043f8
...
@@ -66,7 +66,7 @@ def setup_webdav_client(private):
...
@@ -66,7 +66,7 @@ def setup_webdav_client(private):
return
c
return
c
def
remove_old_beta_packages
(
client
,
path
,
dry_run
,
pyver
=
True
):
def
remove_old_beta_packages
(
client
,
path
,
dry_run
,
pyver
=
True
,
includes
=
None
):
"""
Removes old conda packages from a conda channel.
"""
Removes old conda packages from a conda channel.
What is an old package depends on how the packages are produced. In
What is an old package depends on how the packages are produced. In
...
@@ -100,6 +100,11 @@ def remove_old_beta_packages(client, path, dry_run, pyver=True):
...
@@ -100,6 +100,11 @@ def remove_old_beta_packages(client, path, dry_run, pyver=True):
a package will be a part of a package
'
s name. This is need to account
a package will be a part of a package
'
s name. This is need to account
for the fact that our CI jobs run per Python version.
for the fact that our CI jobs run per Python version.
includes (re.SRE_Pattern): A regular expression that matches the names
of packages that should be considered for clean-up. For example: for
Bob and BATL packages, you may use ``^(bob|batl|gridtk).*`` For BEAT
packages you may use ``^beat.*``
"""
"""
server_path
=
client
.
get_url
(
path
)
server_path
=
client
.
get_url
(
path
)
...
@@ -120,6 +125,11 @@ def remove_old_beta_packages(client, path, dry_run, pyver=True):
...
@@ -120,6 +125,11 @@ def remove_old_beta_packages(client, path, dry_run, pyver=True):
continue
continue
name
,
version
,
build_string
=
f
[:
-
8
].
rsplit
(
"
-
"
,
2
)
name
,
version
,
build_string
=
f
[:
-
8
].
rsplit
(
"
-
"
,
2
)
# see if this package should be included or not in our clean-up
if
(
includes
is
not
None
)
and
(
not
includes
.
match
(
name
)):
continue
hash_
,
build
=
build_string
.
rsplit
(
"
_
"
,
1
)
hash_
,
build
=
build_string
.
rsplit
(
"
_
"
,
1
)
if
pyver
:
if
pyver
:
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/ci.py
+
7
−
0
View file @
c7e043f8
...
@@ -992,8 +992,15 @@ def clean_betas(dry_run):
...
@@ -992,8 +992,15 @@ def clean_betas(dry_run):
echo_warning
(
"
!!!! DRY RUN MODE !!!!
"
)
echo_warning
(
"
!!!! DRY RUN MODE !!!!
"
)
echo_warning
(
"
Nothing is being executed on server.
"
)
echo_warning
(
"
Nothing is being executed on server.
"
)
import
re
if
os
.
environ
[
"
CI_PROJECT_NAMESPACE
"
]
==
"
beat
"
:
includes
=
re
.
compile
(
r
'
^beat.*
'
)
else
:
includes
=
re
.
compile
(
r
'
^(bob|batl|gridtk).*
'
)
clean_betas
(
clean_betas
(
dry_run
=
dry_run
,
dry_run
=
dry_run
,
username
=
os
.
environ
[
"
DOCUSER
"
],
username
=
os
.
environ
[
"
DOCUSER
"
],
password
=
os
.
environ
[
"
DOCPASS
"
],
password
=
os
.
environ
[
"
DOCPASS
"
],
includes
=
includes
,
)
)
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