Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
8d9abda6
Commit
8d9abda6
authored
Apr 24, 2017
by
George Kraft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update kubernetes-e2e charm to use snaps
parent
fb72285a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
56 deletions
+29
-56
test
cluster/juju/layers/kubernetes-e2e/actions/test
+3
-1
config.yaml
cluster/juju/layers/kubernetes-e2e/config.yaml
+6
-0
layer.yaml
cluster/juju/layers/kubernetes-e2e/layer.yaml
+1
-0
metadata.yaml
cluster/juju/layers/kubernetes-e2e/metadata.yaml
+6
-10
kubernetes_e2e.py
...ter/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
+13
-45
No files found.
cluster/juju/layers/kubernetes-e2e/actions/test
View file @
8d9abda6
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
set
-ex
set
-ex
export
PATH
=
"
$PATH
:/snap/bin"
# Grab the action parameter values
# Grab the action parameter values
FOCUS
=
$(
action-get focus
)
FOCUS
=
$(
action-get focus
)
SKIP
=
$(
action-get skip
)
SKIP
=
$(
action-get skip
)
...
@@ -26,7 +28,7 @@ ACTION_JUNIT_TGZ=$ACTION_JUNIT.tar.gz
...
@@ -26,7 +28,7 @@ ACTION_JUNIT_TGZ=$ACTION_JUNIT.tar.gz
# This initializes an e2e build log with the START TIMESTAMP.
# This initializes an e2e build log with the START TIMESTAMP.
echo
"JUJU_E2E_START=
$(
date
-u
+%s
)
"
|
tee
$ACTION_LOG
echo
"JUJU_E2E_START=
$(
date
-u
+%s
)
"
|
tee
$ACTION_LOG
echo
"JUJU_E2E_VERSION=
$(
kubectl version |
grep
Server |
cut
-d
" "
-f
5 |
cut
-d
":"
-f
2 |
sed
s/
\"
// |
sed
s/
\"
,//
)
"
|
tee
-a
$ACTION_LOG
echo
"JUJU_E2E_VERSION=
$(
kubectl version |
grep
Server |
cut
-d
" "
-f
5 |
cut
-d
":"
-f
2 |
sed
s/
\"
// |
sed
s/
\"
,//
)
"
|
tee
-a
$ACTION_LOG
ginkgo
-nodes
=
$PARALLELISM
$(
which e2e.test
)
--
\
GINKGO_ARGS
=
"-nodes=
$PARALLELISM
"
kubernetes-test.e2e
\
-kubeconfig
/home/ubuntu/.kube/config
\
-kubeconfig
/home/ubuntu/.kube/config
\
-host
$SERVER
\
-host
$SERVER
\
-ginkgo
.focus
$FOCUS
\
-ginkgo
.focus
$FOCUS
\
...
...
cluster/juju/layers/kubernetes-e2e/config.yaml
0 → 100644
View file @
8d9abda6
options
:
channel
:
type
:
string
default
:
"
stable"
description
:
|
Snap channel to install Kubernetes snaps from
cluster/juju/layers/kubernetes-e2e/layer.yaml
View file @
8d9abda6
...
@@ -2,6 +2,7 @@ repo: https://github.com/juju-solutions/layer-kubernetes-e2e
...
@@ -2,6 +2,7 @@ repo: https://github.com/juju-solutions/layer-kubernetes-e2e
includes
:
includes
:
-
layer:basic
-
layer:basic
-
layer:tls-client
-
layer:tls-client
-
layer:snap
-
interface:http
-
interface:http
options
:
options
:
tls-client
:
tls-client
:
...
...
cluster/juju/layers/kubernetes-e2e/metadata.yaml
View file @
8d9abda6
...
@@ -15,15 +15,11 @@ requires:
...
@@ -15,15 +15,11 @@ requires:
kubernetes-master
:
kubernetes-master
:
interface
:
http
interface
:
http
resources
:
resources
:
e2e_amd64
:
kubectl
:
type
:
file
type
:
file
filename
:
e2e_amd64.tar.gz
filename
:
kubectl.snap
description
:
Tarball of the e2e binary, and kubectl binary for amd64
description
:
kubectl snap
e2e_ppc64el
:
kubernetes-test
:
type
:
file
type
:
file
filename
:
e2e_ppc64le.tar.gz
filename
:
kubernetes-test.snap
description
:
Tarball of the e2e binary, and kubectl binary for ppc64le
description
:
kubernetes-test snap
e2e_s390x
:
type
:
file
filename
:
e2e_s390x.tar.gz
description
:
Tarball of the e2e binary, and kubectl binary for s390x
cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py
View file @
8d9abda6
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
import
os
import
os
from
charms
import
layer
from
charms
import
layer
from
charms.layer
import
snap
from
charms.reactive
import
hook
from
charms.reactive
import
hook
from
charms.reactive
import
is_state
from
charms.reactive
import
is_state
...
@@ -37,7 +38,7 @@ from subprocess import check_output
...
@@ -37,7 +38,7 @@ from subprocess import check_output
@hook
(
'upgrade-charm'
)
@hook
(
'upgrade-charm'
)
def
reset_delivery_states
():
def
reset_delivery_states
():
''' Remove the state set when resources are unpacked. '''
''' Remove the state set when resources are unpacked. '''
remove_state
(
'kubernetes-e2e.installed'
)
install_snaps
(
)
@when
(
'kubernetes-e2e.installed'
)
@when
(
'kubernetes-e2e.installed'
)
...
@@ -65,52 +66,19 @@ def messaging():
...
@@ -65,52 +66,19 @@ def messaging():
hookenv
.
status_set
(
'active'
,
'Ready to test.'
)
hookenv
.
status_set
(
'active'
,
'Ready to test.'
)
@when_not
(
'kubernetes-e2e.installed'
)
@when
(
'config.changed.channel'
)
def
install_kubernetes_e2e
():
def
channel_changed
():
''' Deliver the e2e and kubectl components from the binary resource stream
install_snaps
()
packages declared in the charm '''
charm_dir
=
os
.
getenv
(
'CHARM_DIR'
)
arch
=
determine_arch
()
# Get the resource via resource_get
resource
=
'e2e_{}'
.
format
(
arch
)
try
:
archive
=
hookenv
.
resource_get
(
resource
)
except
Exception
:
message
=
'Error fetching the {} resource.'
.
format
(
resource
)
hookenv
.
log
(
message
)
hookenv
.
status_set
(
'blocked'
,
message
)
return
if
not
archive
:
hookenv
.
log
(
'Missing {} resource.'
.
format
(
resource
))
hookenv
.
status_set
(
'blocked'
,
'Missing {} resource.'
.
format
(
resource
))
return
# Handle null resource publication, we check if filesize < 1mb
filesize
=
os
.
stat
(
archive
)
.
st_size
if
filesize
<
1000000
:
hookenv
.
status_set
(
'blocked'
,
'Incomplete {} resource.'
.
format
(
resource
))
return
hookenv
.
status_set
(
'maintenance'
,
'Unpacking {} resource.'
.
format
(
resource
))
unpack_path
=
'{}/files/kubernetes'
.
format
(
charm_dir
)
os
.
makedirs
(
unpack_path
,
exist_ok
=
True
)
cmd
=
[
'tar'
,
'xfvz'
,
archive
,
'-C'
,
unpack_path
]
hookenv
.
log
(
cmd
)
check_call
(
cmd
)
services
=
[
'e2e.test'
,
'ginkgo'
,
'kubectl'
]
for
service
in
services
:
unpacked
=
'{}/{}'
.
format
(
unpack_path
,
service
)
app_path
=
'/usr/local/bin/{}'
.
format
(
service
)
install
=
[
'install'
,
'-v'
,
unpacked
,
app_path
]
call
(
install
)
def
install_snaps
():
''' Deliver the e2e and kubectl components from the binary resource stream
packages declared in the charm '''
channel
=
hookenv
.
config
(
'channel'
)
hookenv
.
status_set
(
'maintenance'
,
'Installing kubectl snap'
)
snap
.
install
(
'kubectl'
,
channel
=
channel
,
classic
=
True
)
hookenv
.
status_set
(
'maintenance'
,
'Installing kubernetes-test snap'
)
snap
.
install
(
'kubernetes-test'
,
channel
=
channel
,
classic
=
True
)
set_state
(
'kubernetes-e2e.installed'
)
set_state
(
'kubernetes-e2e.installed'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment