Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

make: Add build option STATIC=1 to statically link #523

Merged
merged 1 commit into from
Apr 10, 2019

Conversation

teawater
Copy link
Member

@teawater teawater commented Apr 6, 2019

Add build option STATIC=1 to statically link kata-agent.

Fixes: #522

Signed-off-by: Hui Zhu [email protected]

@teawater
Copy link
Member Author

teawater commented Apr 6, 2019

/test

@teawater
Copy link
Member Author

teawater commented Apr 8, 2019

This PR doesn't change the default behavior of kata-agent.
So I think this PR does not relate to this fail.

jenkins-ci-Power8-ubuntu-16-04-initrd failed:

Rebuilds build #75
Rebuilds build #76
Rebuilds build #77
Setting status of 37911551a10a13015ec9958a0671662951c30d70 to PENDING with url http://jenkins.katacontainers.io/job/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/79/ and message: 'Build running'
Using context: jenkins-ci-Power8-ubuntu-16-04-initrd
Building remotely on Power8_slave01 (power8-ubuntu-1604 power8_node) in workspace /home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is disabled by the job configuration...
ERROR: [WS-CLEANUP] Cannot delete workspace: Unable to delete '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/pkg/linux_ppc64le/github.com/kata-containers/tests/vendor/github.com/BurntSushi/toml.a'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
ERROR: Cannot delete workspace: Unable to delete '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/pkg/linux_ppc64le/github.com/kata-containers/tests/vendor/github.com/BurntSushi/toml.a'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
Performing Post build task...
Match found for :.* : True
Logical operation result is TRUE
Running script  : #!/bin/bash

export GOPATH=$WORKSPACE/go
export GOROOT="/usr/local/go"

jenkins-ci-fedora failed:

Running command '/usr/bin/docker [docker run --cidfile /tmp/cid499536092/t2reqkeTK4U4I7rc56qjUeybRTSBs1 --runtime kata-runtime -td --name t2reqkeTK4U4I7rc56qjUeybRTSBs1 fedora sh]'
[docker run --cidfile /tmp/cid499536092/t2reqkeTK4U4I7rc56qjUeybRTSBs1 --runtime kata-runtime -td --name t2reqkeTK4U4I7rc56qjUeybRTSBs1 fedora sh]
Timeout: 120 seconds
Exit Code: 0
Stdout: e5a29c3df12c86eb30476b9a5a3e101719edd7edd0f1e60c9f968a0e8230ae58

Stderr: 
Running command '/usr/bin/docker [docker exec t2reqkeTK4U4I7rc56qjUeybRTSBs1 dnf -y update]'
.
FATAL: command execution failed
java.io.EOFException
	at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
	at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
	at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
	at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358)
	at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
	at hudson.remoting.Command.readFrom(Command.java:140)
	at hudson.remoting.Command.readFrom(Command.java:126)
	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:36)
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
Caused: java.io.IOException: Backing channel 'fedora28-azure910830' is disconnected.
	at hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
	at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
	at com.sun.proxy.$Proxy406.isAlive(Unknown Source)
	at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1144)
	at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1136)
	at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1816)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
FATAL: Unable to delete script file /tmp/jenkins8884414092398990714.sh
java.io.EOFException

Makefile Outdated
@@ -79,7 +79,11 @@ else
SECCOMP=no
endif
# go build common flags
BUILDFLAGS := -buildmode=pie
ifndef STATIC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you should change this condition, I think the following would be easier to understand

ifdef STATIC
	LDFLAGS := -extldflags '-static'
else
	BUILDFLAGS := -buildmode=pie
endif

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you should change this condition, I think the following would be easier to understand

ifdef STATIC
	LDFLAGS := -extldflags '-static'
else
	BUILDFLAGS := -buildmode=pie
endif

Updated.

@teawater
Copy link
Member Author

teawater commented Apr 9, 2019

/test

@devimc
Copy link

devimc commented Apr 9, 2019

/retest

Add build option STATIC=1 to statically link kata-agent.

Fixes: kata-containers#522

Signed-off-by: Hui Zhu <[email protected]>
@teawater
Copy link
Member Author

/test

@teawater
Copy link
Member Author

jenkins-ci-Power8-ubuntu-16-04-initrd fail:

message: 'Build running'
Using context: jenkins-ci-Power8-ubuntu-16-04-initrd
Building remotely on Power8_slave01 (power8-ubuntu-1604 power8_node) in workspace /home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Deferred wipeout is disabled by the job configuration...
ERROR: [WS-CLEANUP] Cannot delete workspace: Unable to delete '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/pkg/linux_ppc64le/github.com/kata-containers/tests/vendor/github.com/BurntSushi/toml.a'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
ERROR: Cannot delete workspace: Unable to delete '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/pkg/linux_ppc64le/github.com/kata-containers/tests/vendor/github.com/BurntSushi/toml.a'. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
Performing Post build task...
Match found for :.* : True
Logical operation result is TRUE
Running script  : #!/bin/bash

export GOPATH=$WORKSPACE/go
export GOROOT="/usr/local/go"
export PATH=${GOPATH}/bin:/usr/local/go/bin:/usr/sbin:/usr/local/bin:${PATH}

cd $GOPATH/src/github.com/kata-containers/tests
.ci/teardown.sh "$WORKSPACE/artifacts"
[kata-containers-agent-Power8-ubuntu-16-04-PR-initrd] $ /bin/bash /tmp/jenkins3234829594900103113.sh
~/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/artifacts ~/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests
~/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests
INFO: Checking log files
make -C cmd/log-parser
make[1]: Entering directory '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/cmd/log-parser'
go test .
ok  	github.com/kata-containers/tests/cmd/log-parser	(cached)
go build -o "kata-log-parser" -ldflags "-X main.name=kata-log-parser -X main.commit="54e02fb1181339c12405994d667049be039b5fe2" -X main.version=0.0.1" .
install -d /home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/bin
install kata-log-parser /home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/bin/kata-log-parser
make[1]: Leaving directory '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/cmd/log-parser'
time="2019-04-10T12:07:53.800806342+05:30" level=debug msg="ignoring empty file \"/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/kata-ksm-throttler.log\"\n" commit=54e02fb1181339c12405994d667049be039b5fe2 name=kata-log-parser pid=37782 source=log-parser version=0.0.1
time="2019-04-10T12:07:53.801036005+05:30" level=debug msg="ignoring empty file \"/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/kata-vc-throttler.log\"\n" commit=54e02fb1181339c12405994d667049be039b5fe2 name=kata-log-parser pid=37782 source=log-parser version=0.0.1
ERROR: kata-log-parser: missing pid: {Count:0 TimeDelta:0 Filename:/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/kata-runtime.log Line:4 Time:2019-02-26 01:40:16.184603392 +0530 IST Pid:0 Level:debug Msg:New filesystem store backend for /var/lib/vc/sbs/5b2c8faa5b44c156ecd03acb5129418318edf10611e89b26dc0a7d5b5e5d4c66 Source:virtcontainers/store Name: Container: Sandbox: Data:map[backend:filesystem path:/var/lib/vc/sbs/5b2c8faa5b44c156ecd03acb5129418318edf10611e89b26dc0a7d5b5e5d4c66 subsystem:store]}
ERROR: detected fatal error in '/home/jenkins/workspace/kata-containers-agent-Power8-ubuntu-16-04-PR-initrd/go/src/github.com/kata-containers/tests/kata-proxy.log'
time="2019-02-26T02:08:19.124363158+05:30" level=info msg="time=\"2019-02-25T20:38:18.941210728Z\" level=debug msg=\"request end\" duration=590.672127ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=384a43c7d60c5d808d9fa996190a5a67d89073f90b7838840e6aecca69c156b5 source=agent
" name=kata-proxy pid=3649 sandbox=384a43c7d60c5d808d9fa996190a5a67d89073f90b7838840e6aecca69c156b5 source=agent
time="2019-02-26T07:52:13.619574965+05:30" level=info msg="time=\"2019-02-26T02:22:14.035911828Z\" level=debug msg=\"request end\" duration=660.563666ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=d0d323b837d4ea70c1feeaf2d22e9984961d94c09b1b4fa17054703be478d6ba source=agent
" name=kata-proxy pid=9903 sandbox=d0d323b837d4ea70c1feeaf2d22e9984961d94c09b1b4fa17054703be478d6ba source=agent
time="2019-02-26T16:25:31.930421554+05:30" level=info msg="time=\"2019-02-26T10:55:31.959161832Z\" level=debug msg=\"request end\" duration=591.368892ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=2d453577b0124ce84114f07a68735d9924dfd54d291b69fcc455b245da91d014 source=agent
" name=kata-proxy pid=72296 sandbox=2d453577b0124ce84114f07a68735d9924dfd54d291b69fcc455b245da91d014 source=agent
time="2019-02-26T20:57:21.124193507+05:30" level=info msg="time=\"2019-02-26T15:27:19.929845929Z\" level=debug msg=\"request end\" duration=581.105955ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=91e39ddcf4ec9ac9cf799489e2d61c3f54ec2508f0a0fa0492fded9f7a281f06 source=agent
" name=kata-proxy pid=72266 sandbox=91e39ddcf4ec9ac9cf799489e2d61c3f54ec2508f0a0fa0492fded9f7a281f06 source=agent
time="2019-02-26T22:29:49.007219335+05:30" level=info msg="time=\"2019-02-26T16:59:49.206960814Z\" level=debug msg=\"request end\" duration=845.029559ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=684b8255aa1ef0bf09a01cc397065c9eafe450312b8ea56c5b41292933cd9b9e source=agent
" name=kata-proxy pid=42891 sandbox=684b8255aa1ef0bf09a01cc397065c9eafe450312b8ea56c5b41292933cd9b9e source=agent
time="2019-02-26T23:43:55.35317208+05:30" level=info msg="time=\"2019-02-26T18:13:55.005946845Z\" level=debug msg=\"request end\" duration=638.652553ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=dc33d8aabbbf33c7ccaee9fa5c5856be529c59fbb4681356c280fd94add4c792 source=agent
" name=kata-proxy pid=54778 sandbox=dc33d8aabbbf33c7ccaee9fa5c5856be529c59fbb4681356c280fd94add4c792 source=agent
time="2019-02-27T10:14:37.817227858+05:30" level=info msg="time=\"2019-02-27T04:44:36.919450785Z\" level=debug msg=\"request end\" duration=574.778333ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=e421b5a0178f3136944cc05a1a7017a76991cbff4dbf76f57b5060bc8059db9f source=agent
" name=kata-proxy pid=32140 sandbox=e421b5a0178f3136944cc05a1a7017a76991cbff4dbf76f57b5060bc8059db9f source=agent
time="2019-02-27T12:12:36.863138546+05:30" level=info msg="time=\"2019-02-27T06:42:36.918524734Z\" level=debug msg=\"request end\" duration=579.656275ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=875e94b679c6e0a33b2042f32324f10ca99766733c0f93bd7335089c490f1387 source=agent
" name=kata-proxy pid=7680 sandbox=875e94b679c6e0a33b2042f32324f10ca99766733c0f93bd7335089c490f1387 source=agent
time="2019-02-27T16:27:10.57438033+05:30" level=info msg="time=\"2019-02-27T10:57:10.009616066Z\" level=debug msg=\"request end\" duration=669.193707ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=6a78ea86a80905383f3e7ca4164a971f62b748a7e1163499c30abde4554291c4 source=agent
" name=kata-proxy pid=33015 sandbox=6a78ea86a80905383f3e7ca4164a971f62b748a7e1163499c30abde4554291c4 source=agent
time="2019-02-28T11:38:20.405422838+05:30" level=info msg="time=\"2019-02-28T06:08:19.967019146Z\" level=debug msg=\"request end\" duration=593.89575ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=ef1a670b20ec83acaba3db567b4f8b364629b4da4d612eacf613c6083ce81d4c source=agent
" name=kata-proxy pid=1294 sandbox=ef1a670b20ec83acaba3db567b4f8b364629b4da4d612eacf613c6083ce81d4c source=agent
time="2019-02-28T19:47:14.743040721+05:30" level=info msg="time=\"2019-02-28T14:17:13.928466277Z\" level=debug msg=\"request end\" duration=572.466682ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=e53cfb8b997de770e6001441c2d494aa394bf599d9009629460efc5559bd2a46 source=agent
" name=kata-proxy pid=30430 sandbox=e53cfb8b997de770e6001441c2d494aa394bf599d9009629460efc5559bd2a46 source=agent
time="2019-02-28T21:16:36.628966104+05:30" level=info msg="time=\"2019-02-28T15:46:36.948492357Z\" level=debug msg=\"request end\" duration=604.431578ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=6be076454625b9b5c99352a94de2d4135820a032c650e8b330178b1a88d9f95b source=agent
" name=kata-proxy pid=25732 sandbox=6be076454625b9b5c99352a94de2d4135820a032c650e8b330178b1a88d9f95b source=agent
time="2019-03-01T05:20:29.575563921+05:30" level=info msg="time=\"2019-02-28T23:50:29.953261236Z\" level=debug msg=\"request end\" duration=590.471961ms name=kata-agent pid=1 request=/grpc.AgentService/ReadStderr resp=\"data:\\"fatal error: \\" \" sandbox=912bad746b52790ef2783462810c6b4b2318b74f352291c1eb50fbc84aefa0e5 source=agent
" name=kata-proxy pid=46772 sandbox=912bad746b52790ef2783462810c6b4b2318b74f352291c1eb50fbc84aefa0e5 source=agent
POST BUILD TASK : FAILURE
END OF POST BUILD TASK : 0
Archiving artifacts

This PR doesn't change the default behavior of kata-agent.
So I think this PR does not relate to this fail.

@bergwolf bergwolf merged commit aa37186 into kata-containers:master Apr 10, 2019
@grahamwhaley
Copy link
Contributor

@nitkon ^^^ can you have a check of the power8 CI slave status?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants