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
e9034f1e
Commit
e9034f1e
authored
Aug 04, 2016
by
Vishnu kannan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make GCI the default node e2e test image. Fix bugs in runner
Signed-off-by:
Vishnu kannan
<
vishnuk@google.com
>
parent
2f6514bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
19 deletions
+26
-19
test-e2e-node.sh
hack/make-rules/test-e2e-node.sh
+7
-4
image_list.go
test/e2e_node/image_list.go
+7
-2
gci-init.yaml
test/e2e_node/jenkins/gci-init.yaml
+4
-5
run_e2e.go
test/e2e_node/runner/run_e2e.go
+8
-8
No files found.
hack/make-rules/test-e2e-node.sh
View file @
e9034f1e
...
@@ -31,17 +31,20 @@ artifacts=${ARTIFACTS:-"/tmp/_artifacts"}
...
@@ -31,17 +31,20 @@ artifacts=${ARTIFACTS:-"/tmp/_artifacts"}
remote
=
${
REMOTE
:-
"false"
}
remote
=
${
REMOTE
:-
"false"
}
images
=
${
IMAGES
:-
""
}
images
=
${
IMAGES
:-
""
}
hosts
=
${
HOSTS
:-
""
}
hosts
=
${
HOSTS
:-
""
}
metadata
=
${
INSTANCE_METADATA
:-
""
}
gci_image
=
$(
gcloud compute images list
--project
google-containers
\
--no-standard-images
--regexp
=
"gci-dev.*"
--format
=
"table[no-heading](name)"
)
if
[[
$hosts
==
""
&&
$images
==
""
]]
;
then
if
[[
$hosts
==
""
&&
$images
==
""
]]
;
then
images
=
"e2e-node-containervm-v20160321-image"
images
=
$gci_image
metadata
=
"user-data<
${
KUBE_ROOT
}
/test/e2e_node/jenkins/gci-init.yaml"
fi
fi
image_project
=
${
IMAGE_PROJECT
:-
"
kubernetes-node-e2e-image
s"
}
image_project
=
${
IMAGE_PROJECT
:-
"
google-container
s"
}
instance_prefix
=
${
INSTANCE_PREFIX
:-
"test"
}
instance_prefix
=
${
INSTANCE_PREFIX
:-
"test"
}
cleanup
=
${
CLEANUP
:-
"true"
}
cleanup
=
${
CLEANUP
:-
"true"
}
delete_instances
=
${
DELETE_INSTANCES
:-
"false"
}
delete_instances
=
${
DELETE_INSTANCES
:-
"false"
}
run_until_failure
=
${
RUN_UNTIL_FAILURE
:-
"false"
}
run_until_failure
=
${
RUN_UNTIL_FAILURE
:-
"false"
}
list_images
=
${
LIST_IMAGES
:-
"false"
}
list_images
=
${
LIST_IMAGES
:-
"false"
}
test_args
=
${
TEST_ARGS
:-
""
}
test_args
=
${
TEST_ARGS
:-
""
}
metadata
=
${
INSTANCE_METADATA
:-
""
}
if
[[
$list_images
==
"true"
]]
;
then
if
[[
$list_images
==
"true"
]]
;
then
gcloud compute images list
--project
=
"
${
image_project
}
"
|
grep
"e2e-node"
gcloud compute images list
--project
=
"
${
image_project
}
"
|
grep
"e2e-node"
...
@@ -126,7 +129,7 @@ if [ $remote = true ] ; then
...
@@ -126,7 +129,7 @@ if [ $remote = true ] ; then
echo
"Ginkgo Flags:
$ginkgoflags
"
echo
"Ginkgo Flags:
$ginkgoflags
"
echo
"Instance Metadata:
$metadata
"
echo
"Instance Metadata:
$metadata
"
# Invoke the runner
# Invoke the runner
go run
test
/e2e_node/runner/run_e2e.go
--logtostderr
--vmodule
=
*
=
2
--ssh-env
=
"gce"
\
go run
test
/e2e_node/runner/run_e2e.go
--logtostderr
--vmodule
=
*
=
4
--ssh-env
=
"gce"
\
--zone
=
"
$zone
"
--project
=
"
$project
"
\
--zone
=
"
$zone
"
--project
=
"
$project
"
\
--hosts
=
"
$hosts
"
--images
=
"
$images
"
--cleanup
=
"
$cleanup
"
\
--hosts
=
"
$hosts
"
--images
=
"
$images
"
--cleanup
=
"
$cleanup
"
\
--results-dir
=
"
$artifacts
"
--ginkgo-flags
=
"
$ginkgoflags
"
\
--results-dir
=
"
$artifacts
"
--ginkgo-flags
=
"
$ginkgoflags
"
\
...
...
test/e2e_node/image_list.go
View file @
e9034f1e
...
@@ -18,6 +18,7 @@ package e2e_node
...
@@ -18,6 +18,7 @@ package e2e_node
import
(
import
(
"os/exec"
"os/exec"
"os/user"
"time"
"time"
"github.com/golang/glog"
"github.com/golang/glog"
...
@@ -66,6 +67,10 @@ var NoPullImageRegistry = map[int]string{
...
@@ -66,6 +67,10 @@ var NoPullImageRegistry = map[int]string{
// Pre-fetch all images tests depend on so that we don't fail in an actual test
// Pre-fetch all images tests depend on so that we don't fail in an actual test
func
PrePullAllImages
()
error
{
func
PrePullAllImages
()
error
{
usr
,
err
:=
user
.
Current
()
if
err
!=
nil
{
return
err
}
for
_
,
image
:=
range
ImageRegistry
{
for
_
,
image
:=
range
ImageRegistry
{
var
(
var
(
err
error
err
error
...
@@ -78,8 +83,8 @@ func PrePullAllImages() error {
...
@@ -78,8 +83,8 @@ func PrePullAllImages() error {
if
output
,
err
=
exec
.
Command
(
"docker"
,
"pull"
,
image
)
.
CombinedOutput
();
err
==
nil
{
if
output
,
err
=
exec
.
Command
(
"docker"
,
"pull"
,
image
)
.
CombinedOutput
();
err
==
nil
{
break
break
}
}
glog
.
Warningf
(
"Failed to pull %s, retrying in %s (%d of %d): %v"
,
glog
.
Warningf
(
"Failed to pull %s
as user %q
, retrying in %s (%d of %d): %v"
,
image
,
imagePullRetryDelay
.
String
(),
i
+
1
,
maxImagePullRetries
,
err
)
image
,
usr
.
Username
,
imagePullRetryDelay
.
String
(),
i
+
1
,
maxImagePullRetries
,
err
)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"Could not pre-pull image %s %v output: %s"
,
image
,
err
,
output
)
glog
.
Warningf
(
"Could not pre-pull image %s %v output: %s"
,
image
,
err
,
output
)
...
...
test/e2e_node/jenkins/gci-init.yaml
View file @
e9034f1e
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
runcmd
:
runcmd
:
-
mount /tmp /tmp -o remount,exec,suid
-
mount /tmp /tmp -o remount,exec,suid
-
ETCD_VERSION=v3.0.3
-
etcd_version=v2.2.5
-
curl -L https://github.com/coreos/etcd/releases/download/${
ETCD_VERSION}/etcd-${ETCD_VERSION
}-linux-amd64.tar.gz -o /tmp/etcd.tar.gz
-
curl -L https://github.com/coreos/etcd/releases/download/${
etcd_version}/etcd-${etcd_version
}-linux-amd64.tar.gz -o /tmp/etcd.tar.gz
-
tar xzvf /tmp/etcd.tar.gz -C /tmp
-
tar xzvf /tmp/etcd.tar.gz -C /tmp
-
cp /tmp/etcd-${ETCD_VERSION}-linux-amd64/etcd* /tmp/
-
cp /tmp/etcd-${etcd_version}-linux-amd64/etcd* /tmp/
-
rm -rf /tmp/etcd-${ETCD_VERSION}-linux-amd64/
-
rm -rf /tmp/etcd-${etcd_version}-linux-amd64/
-
usermod -a -G docker jenkins
test/e2e_node/runner/run_e2e.go
View file @
e9034f1e
...
@@ -119,6 +119,12 @@ func main() {
...
@@ -119,6 +119,12 @@ func main() {
if
*
hosts
==
""
&&
*
imageConfigFile
==
""
&&
*
images
==
""
{
if
*
hosts
==
""
&&
*
imageConfigFile
==
""
&&
*
images
==
""
{
glog
.
Fatalf
(
"Must specify one of --image-config-file, --hosts, --images."
)
glog
.
Fatalf
(
"Must specify one of --image-config-file, --hosts, --images."
)
}
}
var
err
error
computeService
,
err
=
getComputeClient
()
if
err
!=
nil
{
glog
.
Fatalf
(
"Unable to create gcloud compute service using defaults. Make sure you are authenticated. %v"
,
err
)
}
gceImages
:=
&
internalImageConfig
{
gceImages
:=
&
internalImageConfig
{
images
:
make
(
map
[
string
]
internalGCEImage
),
images
:
make
(
map
[
string
]
internalGCEImage
),
}
}
...
@@ -133,7 +139,7 @@ func main() {
...
@@ -133,7 +139,7 @@ func main() {
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Fatalf
(
"Could not parse image config file: %v"
,
err
)
glog
.
Fatalf
(
"Could not parse image config file: %v"
,
err
)
}
}
for
key
,
imageConfig
:=
range
externalImageConfig
.
Images
{
for
_
,
imageConfig
:=
range
externalImageConfig
.
Images
{
var
images
[]
string
var
images
[]
string
if
imageConfig
.
ImageRegex
!=
""
&&
imageConfig
.
Image
==
""
{
if
imageConfig
.
ImageRegex
!=
""
&&
imageConfig
.
Image
==
""
{
images
,
err
=
getGCEImages
(
imageConfig
.
ImageRegex
,
imageConfig
.
Project
,
imageConfig
.
PreviousImages
)
images
,
err
=
getGCEImages
(
imageConfig
.
ImageRegex
,
imageConfig
.
Project
,
imageConfig
.
PreviousImages
)
...
@@ -201,12 +207,6 @@ func main() {
...
@@ -201,12 +207,6 @@ func main() {
go
arc
.
getArchive
()
go
arc
.
getArchive
()
defer
arc
.
deleteArchive
()
defer
arc
.
deleteArchive
()
var
err
error
computeService
,
err
=
getComputeClient
()
if
err
!=
nil
{
glog
.
Fatalf
(
"Unable to create gcloud compute service using defaults. Make sure you are authenticated. %v"
,
err
)
}
results
:=
make
(
chan
*
TestResult
)
results
:=
make
(
chan
*
TestResult
)
running
:=
0
running
:=
0
for
shortName
:=
range
gceImages
.
images
{
for
shortName
:=
range
gceImages
.
images
{
...
@@ -329,7 +329,7 @@ type imageObj struct {
...
@@ -329,7 +329,7 @@ type imageObj struct {
}
}
func
(
io
imageObj
)
string
()
string
{
func
(
io
imageObj
)
string
()
string
{
return
fmt
.
Sprintf
(
"%q created %
%
q"
,
io
.
name
,
io
.
creationTime
.
String
())
return
fmt
.
Sprintf
(
"%q created %q"
,
io
.
name
,
io
.
creationTime
.
String
())
}
}
type
byCreationTime
[]
imageObj
type
byCreationTime
[]
imageObj
...
...
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