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
e8348d03
Commit
e8348d03
authored
9 years ago
by
Jenkins
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Move the install base type check to kolla-build"
parents
33484d7a
db53ad1d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docker/base/Dockerfile.j2
+0
-22
0 additions, 22 deletions
docker/base/Dockerfile.j2
kolla/cmd/build.py
+15
-0
15 additions, 0 deletions
kolla/cmd/build.py
kolla/tests/test_build.py
+26
-0
26 additions, 0 deletions
kolla/tests/test_build.py
with
41 additions
and
22 deletions
docker/base/Dockerfile.j2
+
0
−
22
View file @
e8348d03
...
@@ -3,28 +3,6 @@ MAINTAINER {{ maintainer }}
...
@@ -3,28 +3,6 @@ MAINTAINER {{ maintainer }}
LABEL kolla_version="{{ kolla_version }}"
LABEL kolla_version="{{ kolla_version }}"
{# Early failure for bases and types #}
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
{% if install_type not in ['source', 'binary', 'rdo', 'rhel'] %}
RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% elif base_distro in ['ubuntu', 'debian'] %}
{% if install_type not in ['source','binary'] %}
RUN echo 'ERROR: {{ install_type }} is unavailable for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% else %}
RUN echo 'ERROR: The specified distro has no Kolla images to build: "{{ base_distro }}"' \
&& /bin/false
{% endif %}
{{ include_header }}
{{ include_header }}
...
...
This diff is collapsed.
Click to expand it.
kolla/cmd/build.py
+
15
−
0
View file @
e8348d03
...
@@ -64,6 +64,10 @@ class KollaUnknownBuildTypeException(Exception):
...
@@ -64,6 +64,10 @@ class KollaUnknownBuildTypeException(Exception):
pass
pass
class
KollaMismatchBaseTypeException
(
Exception
):
pass
class
KollaRpmSetupUnknownConfig
(
Exception
):
class
KollaRpmSetupUnknownConfig
(
Exception
):
pass
pass
...
@@ -322,6 +326,17 @@ class KollaWorker(object):
...
@@ -322,6 +326,17 @@ class KollaWorker(object):
rpm_setup_config
=
filter
(
None
,
conf
.
rpm_setup_config
)
rpm_setup_config
=
filter
(
None
,
conf
.
rpm_setup_config
)
self
.
rpm_setup
=
self
.
build_rpm_setup
(
rpm_setup_config
)
self
.
rpm_setup
=
self
.
build_rpm_setup
(
rpm_setup_config
)
rh_base
=
[
'
fedora
'
,
'
centos
'
,
'
oraclelinux
'
,
'
rhel
'
]
rh_type
=
[
'
source
'
,
'
binary
'
,
'
rdo
'
,
'
rhos
'
]
deb_base
=
[
'
ubuntu
'
,
'
debian
'
]
deb_type
=
[
'
source
'
,
'
binary
'
]
if
not
((
self
.
base
in
rh_base
and
self
.
install_type
in
rh_type
)
or
(
self
.
base
in
deb_base
and
self
.
install_type
in
deb_type
)):
raise
KollaMismatchBaseTypeException
(
'
{} is unavailable for {}
'
.
format
(
self
.
install_type
,
self
.
base
)
)
if
self
.
install_type
==
'
binary
'
:
if
self
.
install_type
==
'
binary
'
:
self
.
install_metatype
=
'
rdo
'
self
.
install_metatype
=
'
rdo
'
elif
self
.
install_type
==
'
source
'
:
elif
self
.
install_type
==
'
source
'
:
...
...
This diff is collapsed.
Click to expand it.
kolla/tests/test_build.py
+
26
−
0
View file @
e8348d03
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
# limitations under the License.
# limitations under the License.
import
fixtures
import
fixtures
import
itertools
import
mock
import
mock
import
os
import
os
...
@@ -102,3 +103,28 @@ class WorkerThreadTest(base.TestCase):
...
@@ -102,3 +103,28 @@ class WorkerThreadTest(base.TestCase):
path
=
FAKE_IMAGE
[
'
path
'
],
tag
=
FAKE_IMAGE
[
'
fullname
'
],
path
=
FAKE_IMAGE
[
'
path
'
],
tag
=
FAKE_IMAGE
[
'
fullname
'
],
nocache
=
False
,
rm
=
True
,
pull
=
True
,
forcerm
=
True
,
nocache
=
False
,
rm
=
True
,
pull
=
True
,
forcerm
=
True
,
buildargs
=
build_args
)
buildargs
=
build_args
)
class
KollaWorkerTest
(
base
.
TestCase
):
def
test_supported_base_type
(
self
):
rh_base
=
[
'
fedora
'
,
'
centos
'
,
'
oraclelinux
'
,
'
rhel
'
]
rh_type
=
[
'
source
'
,
'
binary
'
,
'
rdo
'
,
'
rhos
'
]
deb_base
=
[
'
ubuntu
'
,
'
debian
'
]
deb_type
=
[
'
source
'
,
'
binary
'
]
for
base_distro
,
install_type
in
itertools
.
chain
(
itertools
.
product
(
rh_base
,
rh_type
),
itertools
.
product
(
deb_base
,
deb_type
)):
self
.
conf
.
set_override
(
'
base
'
,
base_distro
)
self
.
conf
.
set_override
(
'
install_type
'
,
install_type
)
# should no exception raised
build
.
KollaWorker
(
self
.
conf
)
def
test_unsupported_base_type
(
self
):
for
base_distro
,
install_type
in
itertools
.
product
(
[
'
ubuntu
'
,
'
debian
'
],
[
'
rdo
'
,
'
rhos
'
]):
self
.
conf
.
set_override
(
'
base
'
,
base_distro
)
self
.
conf
.
set_override
(
'
install_type
'
,
install_type
)
self
.
assertRaises
(
build
.
KollaMismatchBaseTypeException
,
build
.
KollaWorker
,
self
.
conf
)
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