Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Very Demiurge Very Mindful
Kolla Ansible
Commits
33531712
Commit
33531712
authored
9 years ago
by
Jenkins
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Implement source fetching for build.py"
parents
f5b053a6
0b605f30
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.ini
+4
-0
4 additions, 0 deletions
build.ini
tools/build.py
+34
-1
34 additions, 1 deletion
tools/build.py
with
38 additions
and
1 deletion
build.ini
0 → 100644
+
4
−
0
View file @
33531712
[keystone]
type
=
url
location
=
http://tarballs.openstack.org/keystone/keystone-master.tar.gz
dest_filename
=
keystone.tar
This diff is collapsed.
Click to expand it.
tools/build.py
+
34
−
1
View file @
33531712
...
...
@@ -20,11 +20,13 @@
# TODO(jpeeler): Add clean up handler for SIGINT
import
argparse
import
ConfigParser
import
datetime
import
json
import
logging
import
os
import
Queue
import
requests
import
shutil
import
signal
import
sys
...
...
@@ -66,6 +68,18 @@ class WorkerThread(Thread):
traceback
.
print_exc
()
self
.
queue
.
task_done
()
def
process_source
(
self
,
source
,
dest_dir
):
if
source
[
'
type
'
]
==
'
url
'
:
r
=
requests
.
get
(
source
[
'
source
'
])
if
r
.
status_code
==
200
:
with
open
(
os
.
path
.
join
(
dest_dir
,
source
[
'
dest
'
]),
'
wb
'
)
as
f
:
f
.
write
(
r
.
content
)
else
:
LOG
.
error
(
'
Failed to download tarball: status_code {}
'
.
format
(
r
.
status_code
))
def
builder
(
self
,
image
):
LOG
.
info
(
'
Processing: {}
'
.
format
(
image
[
'
name
'
]))
image
[
'
status
'
]
=
"
building
"
...
...
@@ -75,6 +89,9 @@ class WorkerThread(Thread):
image
[
'
status
'
]
=
"
parent_error
"
return
if
image
[
'
source
'
]:
self
.
process_source
(
image
[
'
source
'
],
image
[
'
path
'
])
# Pull the latest image for the base distro only
pull
=
True
if
image
[
'
parent
'
]
is
None
else
False
...
...
@@ -92,6 +109,7 @@ class WorkerThread(Thread):
if
self
.
threads
==
1
:
LOG
.
info
(
'
{}:{}
'
.
format
(
image
[
'
name
'
],
stream
[
'
stream
'
].
rstrip
()))
if
'
errorDetail
'
in
stream
:
image
[
'
status
'
]
=
"
error
"
LOG
.
error
(
stream
[
'
errorDetail
'
][
'
message
'
])
...
...
@@ -168,6 +186,8 @@ class KollaWorker(object):
self
.
type_
=
args
[
'
type
'
]
self
.
tag
=
args
[
'
tag
'
]
self
.
prefix
=
self
.
base
+
'
-
'
+
self
.
type_
+
'
-
'
self
.
config
=
ConfigParser
.
SafeConfigParser
()
self
.
config
.
read
(
os
.
path
.
join
(
sys
.
path
[
0
],
'
..
'
,
'
build.ini
'
))
self
.
image_statuses_bad
=
{}
self
.
image_statuses_good
=
{}
...
...
@@ -304,10 +324,23 @@ class KollaWorker(object):
if
self
.
namespace
not
in
image
[
'
parent
'
]:
image
[
'
parent
'
]
=
None
if
self
.
type_
==
'
source
'
:
image
[
'
source
'
]
=
dict
()
try
:
image
[
'
source
'
][
'
type
'
]
=
self
.
config
.
get
(
image
[
'
name
'
],
'
type
'
)
image
[
'
source
'
][
'
source
'
]
=
self
.
config
.
get
(
image
[
'
name
'
],
'
location
'
)
image
[
'
source
'
][
'
dest
'
]
=
self
.
config
.
get
(
image
[
'
name
'
],
'
dest_filename
'
)
except
ConfigParser
.
NoSectionError
:
LOG
.
debug
(
'
No config found for {}
'
.
format
(
image
[
'
name
'
]))
pass
self
.
images
.
append
(
image
)
def
buildQueues
(
self
):
"""
Organizes Queue list
"""
Organizes Queue list
Return a list of Queues that have been organized into a hierarchy
based on dependencies
...
...
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