drone.io: containerd: write /proc/14/oom_score_adj: permission denied - drone.io

I am trying to reverse engineer the drone.io docker plugin and understand how to run the docker daemon in a pipeline step (DinD).
drone.io uses the library github.com/cncd/pipeline to compile and execute .drone.yml files.
The first thing the plugins/docker does is to start the docker daemon:
+ /usr/local/bin/dockerd -g /var/lib/docker
This works if fine in the official plugin, but I cannot get it to work with my own image where I do the same:
pipeline.yml
workspace:
base: /go
path: src/github.com/fnbk/hello
pipeline:
test:
image: fnbk/drone-daemon
fnbk/drone-daemon/run.sh
#!/bin/sh
/usr/local/bin/dockerd # <= ERROR: containerd: write /proc/17/oom_score_adj: permission denied
# ...
It will give me the following error:
containerd: write /proc/14/oom_score_adj: permission denied
The full example can be found on github: https://github.com/cncd/pipeline/pull/45
Any suggestions are highly appreciated.

You need to add your plugin to a whitelist via the DRONE_ESCALATE environment variable, which is passed to the server. This is the default value:
DRONE_ESCALATE=plugins/docker,plugins/gcr,plugins/ecr
So you would pass something like this:
-DRONE_ESCALATE=plugins/docker,plugins/gcr,plugins/ecr
+DRONE_ESCALATE=plugins/docker,plugins/gcr,plugins/ecr,fnbk/my-custom-plugin
Note that this should be the image name only. It must not include the tag.

Related

dbt: could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS

I'm trying to connect dbt to BigQuery in vscode. For that I extracted a bigquery keyfile json that I put into the root directory of my dbt project.
I then created a profiles.yml file that looks as follows:
my-bigquery-db:
target: dev
outputs:
dev:
type: bigquery
method: service-account
project: civil-parsec-350114
dataset: dbt_dataset
threads: 1
keyfile: bigquery.json
Database Error
Runtime Error
dbt encountered an error while trying to read your profiles.yml file.
Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
When I put an empty projects.yml file I get the same error, so I'm not even sure if that file is loaded at all. How can I best debug this? What could be the problem?

Where is locate pidfile | docker for windows | docker.pid

I would like to have docker inside docker for use CI-agent. But for it I need to share docker.pid file inside docker container and I can't find that file in this path C:\ProgramData\docker.pid and even I try to add this in docker daemon config:
{
...
"pidfile": "C:\\docker.pid",
...
}
And after a restart, that file didn't appear.
Could you please help me?
Also tried different variant in config file like "C:\docker.pid", "C:/docker.pid". The same behavior.
The docker logs is clean about creating or removing docker.pid file.
Software info
Windows Version: 10 1809 build 17763
Docker for Windows Version: 2.0.0.2 31259
Expected behavior
Create pid file in path C:\docker.pid
Actual behavior
The file is absent
Also created an issue in github
https://github.com/docker/for-win/issues/3741
I found a way to run Docker inside docker.
These two topics help me:
https://forums.docker.com/t/solved-using-docker-inside-another-container/12222/3
Bind to docker socket on Windows
I needed docker.sock file and it locate //var/run/docker.sock so
-v //var/run/docker.sock:/var/run/docker.sock
resolve my problem.

Openwhisk serverless setup on premise

I want to setup apache openwhisk on-premise in my organization. so that we can use it internally within the org. i am not able to find much on the net on this. i tried cloning the code from git and building it in the windows. but it doesn't work. kindly help
Follow these steps to start the platform in a virtual machine in your local environment.
# Clone openwhisk
git clone --depth=1 https://github.com/openwhisk/openwhisk.git
# Change directory to tools/vagrant
cd openwhisk/tools/vagrant
# Run script to create vm and run hello action
./hello
If this works, you should see the following output.
wsk action invoke /whisk.system/utils/echo -p message hello --result
{
"message": "hello"
}
If you encounter problems with these steps, please open an issue in the Github repository for the project.
Deploy OpenWhisk using the ansible playbook in high-availability mode.

Cannot deploy smart contract with Eris / Monax

I'm following the Getting Started Tutorial, using eris version 0.12.0
I stuck at the point where to deploy the smart contract ~/.eris/apps/idi/idi.sol
eris pkgs do --chain simplechain --address $addr
By random I get either of following two errors:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Could not perform pkg action: Docker: {"m
ssage":"Cannot link to a non running container: /simplechain-a49e7fc2-45d4-44df
83bf-1dfab6246c13 AS /interactive-67fff395-600b-4161-912b-df11dc6b2807/chain"}
or:
Performing action. This can sometimes take a wee while
Could not perform pkg action service: Docker: {"message":"Invalid container name
(.eris_tmp_-798bc8a1-70bb-45fd-ac23-8468503cdbad), only [a-zA-Z0-9][a-zA-Z0-9_.
-] are allowed"}
When I install eris version 0.11.4 the error looks like this:
Performing action. This can sometimes take a wee while
Sorry, the marmots were unable to load the eris-pm jobs file. Please check your
path.
ERROR => Unsupported Config Type ""
Container interactive-39ac3a49-52fa-4f1d-953e-1662b1af7f21 exited with status 1
I restarted Docker Quickstart Terminal several times and also deleted the default VM in VirtualBox.
What I'm doing wrong? Thanks for help!
In addition to David's answer, you also should run
eval $(docker-machine env eris) to activate the docker-image.
I had been missing the eris docker-machine running. You can check this with
docker-machine ls
And you can recreate it with:
docker-machine create -d virtualbox eris
Thanks to quick help from Monax / Eris team.

Publishing an .apk into IBM Application Center from Application Center command-line tools

I'm trying to publish an .apk into my Application Center through console. I've followed this note but it doesn't work in my environment:
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/moving-production/distributing-mobile-applications-with-application-center/#cmdLineTools
If I type :
./acdeploytool.sh /home/miguel/Downloads/HelloWorldMyHelloAndroid.apk
I get this error message:
FWLAC0803E: Unable to connect:
Connection refused
Perhaps the server or context is wrongly specified.
File:/home/myUser/Downloads/HelloWorldMyHelloAndroid.apk
And if I try another way using this java command:
java com.ibm.appcenter.Upload -f http://localhost:9080 -c applicationcenter -u demo -p demo /home/myUser/Downloads/HelloWorldMyHelloAndroid.apk
I get this one:
Error: Could not find or load main class com.ibm.appcenter.Upload
I don't get any errors when I do this 'publish' operation directly in Application Center or through MobileFirst Studio.
Miguel, whether you use the script or the Java command, you need to specify the arguments to use. Please try the following:
./acdeploytool.sh -s http://localhost:9080 -c applicationcenter -u demo -p demo /home/miguel/Downloads/HelloWorldMyHelloAndroid.apk
I tried a similar command in my environment and was able to successfully deploy the apk to Application Center. If the command still does not work, make sure that the host/port that you are using are correct, and that the username and password are valid.
For the Java command that you executed, I see a few problems. First, the -cp argument needs to be specified in order to add the applicationcenterdeploytool.jar and json4j.jar files to the classpath. Next, the command shows "-f", but it should be "-s" to specify the server. Lastly, the path that was specified for the .apk is different than what you specified in the first command: myUser vs. miguel. So make sure that the correct path is used. If there are any further questions, let me know. Thanks.