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
af7cd135
Commit
af7cd135
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[scripts][ci] List new files opened
parent
11fd6d23
No related branches found
No related tags found
No related merge requests found
Pipeline
#28957
passed
6 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/log.py
+15
-0
15 additions, 0 deletions
bob/devtools/log.py
bob/devtools/scripts/ci.py
+7
-5
7 additions, 5 deletions
bob/devtools/scripts/ci.py
with
22 additions
and
5 deletions
bob/devtools/log.py
+
15
−
0
View file @
af7cd135
...
...
@@ -229,3 +229,18 @@ def verbosity_option(**kwargs):
"
(e.g.
'
-vvv
'
for debug).
"
,
callback
=
callback
,
**
kwargs
)(
f
)
return
custom_verbosity_option
def
open_files
():
'''
Returns the number of open file descriptors for current process
.. warning: will only work on UNIX-like os-es.
'''
import
os
import
subprocess
pid
=
os
.
getpid
()
procs
=
subprocess
.
check_output
([
'
lsof
'
,
'
-w
'
,
'
-p
'
,
str
(
pid
)])
return
[
k
.
split
()[
-
1
].
decode
(
'
ascii
'
)
for
k
in
procs
.
split
(
b
'
\n
'
)
if
k
][
1
:]
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/ci.py
+
7
−
5
View file @
af7cd135
...
...
@@ -16,7 +16,7 @@ from ..constants import SERVER, CONDA_BUILD_CONFIG, CONDA_RECIPE_APPEND, \
WEBDAV_PATHS
,
BASE_CONDARC
from
..deploy
import
deploy_conda_package
,
deploy_documentation
from
..log
import
verbosity_option
,
get_logger
,
echo_normal
from
..log
import
verbosity_option
,
get_logger
,
echo_normal
,
open_files
logger
=
get_logger
(
__name__
)
...
...
@@ -481,7 +481,6 @@ def nightlies(ctx, order, dry_run):
token
=
os
.
environ
[
'
CI_JOB_TOKEN
'
]
import
git
import
psutil
from
.build
import
build
from
urllib.request
import
urlopen
...
...
@@ -510,8 +509,9 @@ def nightlies(ctx, order, dry_run):
private
=
urlopen
(
'
https://gitlab.idiap.ch/%s
'
%
package
).
getcode
()
!=
200
stable
=
'
STABLE
'
in
os
.
environ
current_open_files
=
open_files
()
logger
.
warn
(
'
Number of open files before build: %d
'
,
len
(
psutil
.
Process
().
open_files
()
))
len
(
current_
open_files
))
ctx
.
invoke
(
build
,
recipe_dir
=
[
os
.
path
.
join
(
clone_to
,
'
conda
'
)],
...
...
@@ -528,8 +528,10 @@ def nightlies(ctx, order, dry_run):
ci
=
True
,
)
logger
.
warn
(
'
Number of open files after build: %d
'
,
len
(
psutil
.
Process
().
open_files
()))
after_open_files
=
open_files
()
logger
.
warn
(
'
Number of open files after build: %d
'
,
len
(
after_open_files
))
logger
.
warn
(
'
New files opened: %s
'
,
'
,
'
.
join
(
list
(
set
(
after_open_files
)
-
set
(
current_open_files
))))
is_master
=
os
.
environ
[
'
CI_COMMIT_REF_NAME
'
]
==
'
master
'
...
...
This diff is collapsed.
Click to expand it.
Tiago de Freitas Pereira
@tiago.pereira
mentioned in issue
#23 (closed)
·
6 years ago
mentioned in issue
#23 (closed)
mentioned in issue #23
Toggle commit list
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