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
69e45dc3
Commit
69e45dc3
authored
Jun 03, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26671 from vishh/node-e2e-images
Automatic merge from submit-queue Support images and instances to exist in different GCP projects for node Forked off from #26314
parents
a00dbea1
60ed2778
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
14 deletions
+47
-14
exceptions.txt
hack/verify-flags/exceptions.txt
+1
-0
known-flags.txt
hack/verify-flags/known-flags.txt
+2
-0
e2e_node_suite_test.go
test/e2e_node/e2e_node_suite_test.go
+1
-0
e2e_remote.go
test/e2e_node/e2e_remote.go
+12
-2
setup_host.sh
test/e2e_node/environment/setup_host.sh
+1
-2
e2e-node-jenkins.sh
test/e2e_node/jenkins/e2e-node-jenkins.sh
+3
-2
jenkins-ci.properties
test/e2e_node/jenkins/jenkins-ci.properties
+3
-0
jenkins-pull.properties
test/e2e_node/jenkins/jenkins-pull.properties
+3
-0
template.properties
test/e2e_node/jenkins/template.properties
+7
-1
run_e2e.go
test/e2e_node/runner/run_e2e.go
+14
-7
No files found.
hack/verify-flags/exceptions.txt
View file @
69e45dc3
...
@@ -70,6 +70,7 @@ docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js:var
...
@@ -70,6 +70,7 @@ docs/getting-started-guides/coreos/azure/lib/deployment_logic/kubernetes.js:var
examples/cassandra/image/run.sh: cluster_name \
examples/cassandra/image/run.sh: cluster_name \
examples/cluster-dns/images/frontend/client.py: service_address = socket.gethostbyname(hostname)
examples/cluster-dns/images/frontend/client.py: service_address = socket.gethostbyname(hostname)
examples/vitess/env.sh: node_ip=$(get_node_ip)
examples/vitess/env.sh: node_ip=$(get_node_ip)
hack/jenkins/e2e-runner.sh: local image_project="$1"
hack/local-up-cluster.sh: runtime_config="--runtime-config=${RUNTIME_CONFIG}"
hack/local-up-cluster.sh: runtime_config="--runtime-config=${RUNTIME_CONFIG}"
hack/local-up-cluster.sh: runtime_config=""
hack/local-up-cluster.sh: runtime_config=""
hack/test-update-storage-objects.sh: local storage_media_type=${2:-""}
hack/test-update-storage-objects.sh: local storage_media_type=${2:-""}
...
...
hack/verify-flags/known-flags.txt
View file @
69e45dc3
...
@@ -194,6 +194,7 @@ ignore-daemonsets
...
@@ -194,6 +194,7 @@ ignore-daemonsets
ignore-not-found
ignore-not-found
image-gc-high-threshold
image-gc-high-threshold
image-gc-low-threshold
image-gc-low-threshold
image-project
image-pull-policy
image-pull-policy
include-extended-apis
include-extended-apis
included-types-overrides
included-types-overrides
...
@@ -411,6 +412,7 @@ service-node-ports
...
@@ -411,6 +412,7 @@ service-node-ports
service-overrides
service-overrides
service-sync-period
service-sync-period
session-affinity
session-affinity
setup-node
show-all
show-all
show-events
show-events
show-labels
show-labels
...
...
test/e2e_node/e2e_node_suite_test.go
View file @
69e45dc3
...
@@ -105,6 +105,7 @@ var _ = AfterSuite(func() {
...
@@ -105,6 +105,7 @@ var _ = AfterSuite(func() {
glog
.
Infof
(
"Stopping node services..."
)
glog
.
Infof
(
"Stopping node services..."
)
e2es
.
stop
()
e2es
.
stop
()
}
}
glog
.
Infof
(
"Tests Finished"
)
glog
.
Infof
(
"Tests Finished"
)
})
})
...
...
test/e2e_node/e2e_remote.go
View file @
69e45dc3
...
@@ -124,9 +124,19 @@ func CreateTestArchive() string {
...
@@ -124,9 +124,19 @@ func CreateTestArchive() string {
return
filepath
.
Join
(
dir
,
archiveName
)
return
filepath
.
Join
(
dir
,
archiveName
)
}
}
// RunRemote copies the archive file to a /tmp file on host, unpacks it, and runs the e2e_node.test
// Returns the command output, whether the exit was ok, and any errors
// Returns the command output, whether the exit was ok, and any errors
func
RunRemote
(
archive
string
,
host
string
,
cleanup
bool
,
junitFileNumber
int
)
(
string
,
bool
,
error
)
{
func
RunRemote
(
archive
string
,
host
string
,
cleanup
bool
,
junitFileNumber
int
,
setupNode
bool
)
(
string
,
bool
,
error
)
{
if
setupNode
{
uname
,
err
:=
user
.
Current
()
if
err
!=
nil
{
return
""
,
false
,
fmt
.
Errorf
(
"could not find username: %v"
,
err
)
}
output
,
err
:=
RunSshCommand
(
"ssh"
,
host
,
"--"
,
"sudo"
,
"usermod"
,
"-a"
,
"-G"
,
"docker"
,
uname
.
Username
)
if
err
!=
nil
{
return
""
,
false
,
fmt
.
Errorf
(
"Instance %s not running docker daemon - Command failed: %s"
,
host
,
output
)
}
}
// Create the temp staging directory
// Create the temp staging directory
glog
.
Infof
(
"Staging test binaries on %s"
,
host
)
glog
.
Infof
(
"Staging test binaries on %s"
,
host
)
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
tmp
:=
fmt
.
Sprintf
(
"/tmp/gcloud-e2e-%d"
,
rand
.
Int31
())
...
...
test/e2e_node/environment/setup_host.sh
View file @
69e45dc3
...
@@ -92,4 +92,4 @@ fi
...
@@ -92,4 +92,4 @@ fi
# delete init kubelet from containervm so that is doesn't startup
# delete init kubelet from containervm so that is doesn't startup
if
[
-f
/etc/init.d/kubelet
]
;
then
if
[
-f
/etc/init.d/kubelet
]
;
then
sudo rm
/etc/init.d/kubelet
sudo rm
/etc/init.d/kubelet
fi
fi
\ No newline at end of file
test/e2e_node/jenkins/e2e-node-jenkins.sh
View file @
69e45dc3
...
@@ -38,6 +38,7 @@ go build test/e2e_node/environment/conformance.go
...
@@ -38,6 +38,7 @@ go build test/e2e_node/environment/conformance.go
ARTIFACTS
=
${
WORKSPACE
}
/_artifacts
ARTIFACTS
=
${
WORKSPACE
}
/_artifacts
mkdir
-p
${
ARTIFACTS
}
mkdir
-p
${
ARTIFACTS
}
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
=
*
=
2
--ssh-env
=
"gce"
\
--zone
=
"
$GCE_ZONE
"
--project
=
"
$GCE_PROJECT
"
\
--zone
=
"
$GCE_ZONE
"
--project
=
"
$GCE_PROJECT
"
--image-project
=
"
$GCE_IMAGE_PROJECT
"
\
--hosts
=
"
$GCE_HOSTS
"
--images
=
"
$GCE_IMAGES
"
--cleanup
=
"
$CLEANUP
"
\
--hosts
=
"
$GCE_HOSTS
"
--images
=
"
$GCE_IMAGES
"
--cleanup
=
"
$CLEANUP
"
\
--results-dir
=
"
$ARTIFACTS
"
--ginkgo-flags
=
"
$GINKGO_FLAGS
"
--results-dir
=
"
$ARTIFACTS
"
--ginkgo-flags
=
"
$GINKGO_FLAGS
"
\
--setup-node
=
"
$SETUP_NODE
"
test/e2e_node/jenkins/jenkins-ci.properties
View file @
69e45dc3
...
@@ -6,6 +6,9 @@ GCE_HOSTS=
...
@@ -6,6 +6,9 @@ GCE_HOSTS=
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image,e2e-node-coreos-stable20160218-image,e2e-node-containervm-v20160321-image
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image,e2e-node-coreos-stable20160218-image,e2e-node-containervm-v20160321-image
GCE_ZONE
=
us-central1-f
GCE_ZONE
=
us-central1-f
GCE_PROJECT
=
kubernetes-jenkins
GCE_PROJECT
=
kubernetes-jenkins
GCE_IMAGE_PROJECT
=
kubernetes-jenkins
INSTALL_GODEP
=
true
INSTALL_GODEP
=
true
CLEANUP
=
true
CLEANUP
=
true
GINKGO_FLAGS
=
GINKGO_FLAGS
=
SETUP_NODE
=
false
test/e2e_node/jenkins/jenkins-pull.properties
View file @
69e45dc3
...
@@ -6,6 +6,8 @@ GCE_HOSTS=
...
@@ -6,6 +6,8 @@ GCE_HOSTS=
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image,e2e-node-coreos-stable20160218-image,e2e-node-containervm-v20160321-image
GCE_IMAGES
=
e2e-node-ubuntu-trusty-docker10-image,e2e-node-ubuntu-trusty-docker9-image,e2e-node-ubuntu-trusty-docker8-image,e2e-node-coreos-stable20160218-image,e2e-node-containervm-v20160321-image
GCE_ZONE
=
us-central1-f
GCE_ZONE
=
us-central1-f
GCE_PROJECT
=
kubernetes-jenkins-pull
GCE_PROJECT
=
kubernetes-jenkins-pull
GCE_IMAGE_PROJECT
=
kubernetes-jenkins-pull
INSTALL_GODEP
=
true
INSTALL_GODEP
=
true
CLEANUP
=
true
CLEANUP
=
true
GINKGO_FLAGS
=
GINKGO_FLAGS
=
SETUP_NODE
=
false
\ No newline at end of file
test/e2e_node/jenkins/template.properties
View file @
69e45dc3
...
@@ -5,9 +5,15 @@ GCE_HOSTS=
...
@@ -5,9 +5,15 @@ GCE_HOSTS=
GCE_IMAGES
=
GCE_IMAGES
=
# Gce zone to use - required when using GCE_IMAGES
# Gce zone to use - required when using GCE_IMAGES
GCE_ZONE
=
GCE_ZONE
=
# Gce project to use - required when using GCE_IMAGES
# Gce project to use for creating instances
# required when using GCE_IMAGES
GCE_PROJECT
=
GCE_PROJECT
=
# Gce project to use for GCE_IMAGES
# required when using GCE_IMAGES
GCE_IMAGE_PROJECT
=
# If true, assume a pristine GOPATH and install necessary godeps
# If true, assume a pristine GOPATH and install necessary godeps
INSTALL_GODEP
=
false
INSTALL_GODEP
=
false
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
# If true, delete instances created from GCE_IMAGES and files copied to GCE_HOSTS
CLEANUP
=
true
CLEANUP
=
true
# If true, current user will be added to the docker group on test node
SETUP_NODE
=
false
test/e2e_node/runner/run_e2e.go
View file @
69e45dc3
...
@@ -41,10 +41,12 @@ import (
...
@@ -41,10 +41,12 @@ import (
var
instanceNamePrefix
=
flag
.
String
(
"instance-name-prefix"
,
""
,
"prefix for instance names"
)
var
instanceNamePrefix
=
flag
.
String
(
"instance-name-prefix"
,
""
,
"prefix for instance names"
)
var
zone
=
flag
.
String
(
"zone"
,
""
,
"gce zone the hosts live in"
)
var
zone
=
flag
.
String
(
"zone"
,
""
,
"gce zone the hosts live in"
)
var
project
=
flag
.
String
(
"project"
,
""
,
"gce project the hosts live in"
)
var
project
=
flag
.
String
(
"project"
,
""
,
"gce project the hosts live in"
)
var
imageProject
=
flag
.
String
(
"image-project"
,
""
,
"gce project the hosts live in"
)
var
images
=
flag
.
String
(
"images"
,
""
,
"images to test"
)
var
images
=
flag
.
String
(
"images"
,
""
,
"images to test"
)
var
hosts
=
flag
.
String
(
"hosts"
,
""
,
"hosts to test"
)
var
hosts
=
flag
.
String
(
"hosts"
,
""
,
"hosts to test"
)
var
cleanup
=
flag
.
Bool
(
"cleanup"
,
true
,
"If true remove files from remote hosts and delete temporary instances"
)
var
cleanup
=
flag
.
Bool
(
"cleanup"
,
true
,
"If true remove files from remote hosts and delete temporary instances"
)
var
buildOnly
=
flag
.
Bool
(
"build-only"
,
false
,
"If true, build e2e_node_test.tar.gz and exit."
)
var
buildOnly
=
flag
.
Bool
(
"build-only"
,
false
,
"If true, build e2e_node_test.tar.gz and exit."
)
var
setupNode
=
flag
.
Bool
(
"setup-node"
,
false
,
"When true, current user will be added to docker group on the test machine"
)
var
computeService
*
compute
.
Service
var
computeService
*
compute
.
Service
...
@@ -70,8 +72,13 @@ func main() {
...
@@ -70,8 +72,13 @@ func main() {
if
*
images
!=
""
&&
*
zone
==
""
{
if
*
images
!=
""
&&
*
zone
==
""
{
glog
.
Fatal
(
"Must specify --zone flag"
)
glog
.
Fatal
(
"Must specify --zone flag"
)
}
}
if
*
images
!=
""
&&
*
project
==
""
{
if
*
images
!=
""
{
glog
.
Fatal
(
"Must specify --project flag"
)
if
*
imageProject
==
""
{
glog
.
Fatal
(
"Must specify --image-project flag"
)
}
if
*
project
==
""
{
glog
.
Fatal
(
"Must specify --project flag"
)
}
}
}
if
*
instanceNamePrefix
==
""
{
if
*
instanceNamePrefix
==
""
{
*
instanceNamePrefix
=
"tmp-node-e2e-"
+
uuid
.
NewUUID
()
.
String
()[
:
8
]
*
instanceNamePrefix
=
"tmp-node-e2e-"
+
uuid
.
NewUUID
()
.
String
()[
:
8
]
...
@@ -123,7 +130,7 @@ func main() {
...
@@ -123,7 +130,7 @@ func main() {
fmt
.
Printf
(
"Initializing e2e tests using host %s.
\n
"
,
host
)
fmt
.
Printf
(
"Initializing e2e tests using host %s.
\n
"
,
host
)
running
++
running
++
go
func
(
host
string
,
junitFileNum
int
)
{
go
func
(
host
string
,
junitFileNum
int
)
{
results
<-
testHost
(
host
,
archive
,
*
cleanup
,
junitFileNum
)
results
<-
testHost
(
host
,
archive
,
*
cleanup
,
junitFileNum
,
*
setupNode
)
}(
host
,
running
)
}(
host
,
running
)
}
}
}
}
...
@@ -153,8 +160,8 @@ func main() {
...
@@ -153,8 +160,8 @@ func main() {
}
}
// Run tests in archive against host
// Run tests in archive against host
func
testHost
(
host
,
archive
string
,
deleteFiles
bool
,
junitFileNum
int
)
*
TestResult
{
func
testHost
(
host
,
archive
string
,
deleteFiles
bool
,
junitFileNum
int
,
setupNode
bool
)
*
TestResult
{
output
,
exitOk
,
err
:=
e2e_node
.
RunRemote
(
archive
,
host
,
deleteFiles
,
junitFileNum
)
output
,
exitOk
,
err
:=
e2e_node
.
RunRemote
(
archive
,
host
,
deleteFiles
,
junitFileNum
,
setupNode
)
return
&
TestResult
{
return
&
TestResult
{
output
:
output
,
output
:
output
,
err
:
err
,
err
:
err
,
...
@@ -175,7 +182,7 @@ func testImage(image, archive string, junitFileNum int) *TestResult {
...
@@ -175,7 +182,7 @@ func testImage(image, archive string, junitFileNum int) *TestResult {
err
:
fmt
.
Errorf
(
"Unable to create gce instance with running docker daemon for image %s. %v"
,
image
,
err
),
err
:
fmt
.
Errorf
(
"Unable to create gce instance with running docker daemon for image %s. %v"
,
image
,
err
),
}
}
}
}
return
testHost
(
host
,
archive
,
false
,
junitFileNum
)
return
testHost
(
host
,
archive
,
false
,
junitFileNum
,
*
setupNode
)
}
}
// Provision a gce instance using image
// Provision a gce instance using image
...
@@ -253,7 +260,7 @@ func imageToInstanceName(image string) string {
...
@@ -253,7 +260,7 @@ func imageToInstanceName(image string) string {
}
}
func
sourceImage
(
image
string
)
string
{
func
sourceImage
(
image
string
)
string
{
return
fmt
.
Sprintf
(
"projects/%s/global/images/%s"
,
*
p
roject
,
image
)
return
fmt
.
Sprintf
(
"projects/%s/global/images/%s"
,
*
imageP
roject
,
image
)
}
}
func
machineType
()
string
{
func
machineType
()
string
{
...
...
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