How to install Argo CLI? - kubernetes

I am trying to install Argo CLI by following this (https://github.com/argoproj/argo-workflows/releases) documentation.
# Download the binary
curl -sLO https://github.com/argoproj/argo/releases/download/v3.1.3/argo-linux-amd64.gz
# Unzip
gunzip argo-linux-amd64.gz
# Make binary executable
chmod +x argo-linux-amd64
# Move binary to path
mv ./argo-linux-amd64 /usr/local/bin/argo
# Test installation
argo version
The above instructions are not working. So, I followed the answer to this (How to update Argo CLI?) question.
curl -sLO https://github.com/argoproj/argo/releases/download/v2.12.0-rc2/argo-linux-amd64
chmod +x argo-linux-amd64
./argo-linux-amd64
But I am getting the following error:
./argo-linux-amd64: line 1: Not: command not found
I also tried moving the argo-linux-amd64 binary to /usr/local/bin/argo but still getting the same error (as expected).
Is there any solution to this?
Thank you.

The download links on the Releases page are incorrect. Try this one:
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.1.3/argo-linux-amd64.gz
I've submitted an issue to get the links fixed.

Related

Not able to run yq commands via rundeck job definitions

I installed snap package of yq and it is showing under /home/ubuntu/ I want to convert yaml file to json using yq. I used this command cat file.yaml | yq . -o=json > file.json to convert the file under location /home/ubuntu/ and this command is working when I run via command line.
But if I try to run this same command in bash shell script in my rundeck job definition, its giving below error.
Sorry, home directories outside of /home are not currently supported. See https://forum.snapcraft.io/t/11209 for details
My Rundeck version is Rundeck 2.6.9-1 and it is running on ubuntu 18
Updated Answer:
I reproduced your issue, and it's a snap package limitation (described here and also commented by Charles Duffy in your original question), Rundeck home it's defined at /var/lib/rundeck path.
So, the best way is to uninstall the snap yq package (as root: snap remove yq) and install it in the traditional way:
As root:
Download and put the yq binary in the /usr/local/bin path:
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
Give it the rights permissions:
chmod a+x /usr/local/bin/yq
Then, your job should work.

Docker-compose: /usr/local/bin/docker-compose : line 1: Not: command not found

i'm trying to install Docker-compose on my Raspberry Pi 3+ which installed Raspbian buster.
I followed instruction on docker.com. After I entered command : sudo curl -L https://github.com/docker/compose/releases/download/1.20.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose.
It show a table for downloading
Result
It seems nothing downloaded, just have a file docker-compose saved in /usr/local/bin/docker-compose. When I opened it, it empty. Then I enter command docker-compose -v, it displayed error /usr/local/bin/docker-compose : line 1: Not: command not found.
Anyone have solution?
UPDATE:
Added the following command to my answer to download the LATEST version without specifying any version number at all so the download can be scripted.
curl -L "https://github.com/docker/compose/releases/download/$(curl https://github.com/docker/compose/releases | grep -m1 '<a href="/docker/compose/releases/download/' | grep -o 'v[0-9:].[0-9].[0-9]')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
It's a bit untidy, but it works. If you have a more elegant way than mine, ping it to me in the comments and I'll update my answer.
Just need to set the perms on the file:
chmod +x /usr/local/bin/docker-compose
Use the file command to validate that you pulled the correct arch for your system.
Intro:
Although docker-compose can be installed from a repo per the accepted answer, apt-cache show docker-compose reveals that as of 20211201 the repo version is only v1.25; about 2 years behind the current v2.1.1 release. In order to take advantage of more modern docker file versions, I needed to get the Github download working.
Short Answer:
The Docker documentation for Docker-Compose is WRONG. They forgot to preface the version number in the command with a "v"; consequently the download fails. Apparently this has been wrong for ages...
Longer Answer:
I ran the below command from the Docker-Compose documentation, and substituted the version "2.1.1" for "1.29.1" per Docker's guidance:
To install a different version of Compose, substitute 1.29.2 with the
version of Compose you want to use.
sudo curl -L "https://github.com/docker/compose/releases/download/2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
The resulting download was 9 KB for a 23 MB binary. Clearly the link was bogus. So I went to the root of the address used in the command "https://github.com/docker/compose/releases" and right-clicked on the version of Docker-Compose that I wanted and chose "Copy Link Address"
This revealed the link Docker was telling folks to use didn't have a "v" prefaced before the version number in the https:// address part of the command.
Solution:
Preface a "v" before the version number you want in the link as below and the command executes successfully:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
BTW, I too was downloading docker-compose for a Raspberry Pi using the aarch64 binary for Ubuntu 20.04 LTS. However, the missing "v" fix for the broken download address should work for any platform.
This is because on a raspberry pi the url part of the command results in
https://github.com/docker/compose/releases/download/1.24.1/docker-compose-Linux-armv7l
Looking at the latest stable release at https://github.com/docker/compose/releases/tag/1.24.1 you can see there is no download for the armv7l architecture so the file is empty because there is nothing to download.
Will update answer once I figured out how to install docker-compose on Raspian.
Edit:
Via apt-get. Note: Currently (Nov. 8 2019) this installs version 1.21 which is not the latest available.
sudo apt-get install docker-compose
Via pip3. (Installs latest)
sudo apt-get install python3-pip
sudo pip3 install docker-compose
And then restart your system with
sudo shutdown -r

Scheme missing linux wget

While trying to install Odoo on Ubuntu 18.04, I ran into an error after running the following command:
sudo wget -O wkhtmltox.tar.xz \ https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
The error said:
https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz: Scheme missing
Please help me if you know the answer to my problem!
You could find all the releases at:
https://github.com/wkhtmltopdf/wkhtmltopdf/releases
Your command fails due to an extra \ before https://. Try this:
sudo wget -O wkhtmltox.tar.xz https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
FYI, There are some issues with wkhtmltopdf that seems to be solved in early versions like 0.12.5
See bug references at:
https://github.com/odoo/odoo/issues/19160
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2711#issuecomment-389429960

How to install Grafana on Mac

I tied the following steps
cd $GOPATH/src/github.com/grafana/grafana
go run build.go setup
I got the following
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
go get -v github.com/tools/godep
github.com/tools/godep (download)
github.com/tools/godep/Godeps/_workspace/src/github.com/kr/fs
github.com/tools/godep/Godeps/_workspace/src/github.com/pmezard/go-difflib/difflib
github.com/tools/godep/Godeps/_workspace/src/golang.org/x/tools/go/vcs
github.com/tools/godep
go get -v github.com/blang/semver
github.com/blang/semver (download)
github.com/blang/semver
go get -v github.com/mattn/go-sqlite3
go install -v github.com/mattn/go-sqlite3
then i executed
$GOPATH/bin/godep restore
i got no putput but command got executed
then i ran the command
go run build.go build
Version: 2.5.0-pre1, Linux Version: 2.5.0, Package Iteration: pre1
rm -r bin
rm -r Godeps/_workspace/pkg
rm -r Godeps/_workspace/bin
rm -r dist
rm -r tmp
rm -r /Users/skhare/sk/go/pkg/darwin_amd64/github.com/grafana
rm -r ./bin/grafana-server
rm -r ./bin/grafana-server.md5
GOPATH=/Users/skhare/sk/go/src/github.com/grafana/grafana/Godeps/_workspace:/Users/skhare/sk/go
go build -ldflags -w -X main.version '2.5.0-pre1' -X main.commit 'v2.1.2+394- gfb767f5' -X main.buildstamp 1442671169 -o ./bin/grafana-server .
# github.com/grafana/grafana
link: warning: option -X main.version 2.5.0-pre1 may not work in future releases; use -X main.version=2.5.0-pre1
link: warning: option -X main.commit v2.1.2+394-gfb767f5 may not work in future releases; use -X main.commit=v2.1.2+394-gfb767f5
link: warning: option -X main.buildstamp 1442671169 may not work in future releases; use -X main.buildstamp=1442671169
then i executed
npm install
i had to install npm
>npm install -g grunt-cli
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
grunt-cli#0.1.13 /usr/local/lib/node_modules/grunt-cli
├── resolve#0.3.1
├── nopt#1.0.10 (abbrev#1.0.7)
└── findup-sync#0.1.3 (lodash#2.4.2, glob#3.2.11)
>grunt
Running "jscs:src" (jscs) task
>> 156 files without code style errors.
Running "jshint:source" (jshint) task
✔ No problems
Running "jshint:tests" (jshint) task
✔ No problems
Running "tslint:source" (tslint) task
>> 11 files lint free.
Running "clean:gen" (clean) task
Cleaning public_gen...OK
Running "copy:public_to_gen" (copy) task
Created 122 directories, copied 553 files
Running "less:src" (less) task
File public_gen/css/bootstrap.dark.min.css created.
File public_gen/css/bootstrap.light.min.css created.
File public_gen/css/bootstrap-responsive.min.css created.
Running "concat:cssDark" (concat) task
File public_gen/css/grafana.dark.min.css created.
Running "concat:cssLight" (concat) task
File public_gen/css/grafana.light.min.css created.
Running "typescript:build" (typescript) task
42 files created. js: 14 files, map: 14 files, declaration: 14 files (968ms)
Done, without errors.
>go get github.com/Unknwon/bra
the above command did not give any output, nor an error message
bra run
it says -bash: bra: command not found
i tried to look for the resolution, but i could not find it. Please help
Recompile backend on source change
To rebuild on source change (requires that you executed godep restore)
go get github.com/Unknwon/bra
bra run
Running Grafana Locally
You can run a local instance of Grafana by running:
./bin/grafana-server
You must have missed this step!
go get github.com/Unknwon/bra
You can install Grafana using home brew.
brew update
brew install grafana
This sounds like an issue where Go is just being installed to build something else (for me, it was Grafana). In which case $GOPATH/bin is not in your PATH. $GOPATH/bin/bra should work. It did for me.
I suggest you installing Grafana inside Docker. If you install Docker for Mac, the GUI (Kitematic) will allow you to install grafana as easily as one click. You will just need to create a new container with "+ New" button, search grafana through the exisiting image lists and click "Create"
Docker will download grafana and it will appear in the left sidebar:

How do I deploy a file to Artifactory using the command line?

I've spent far more time on this than I care to admit. I am trying to just deploy one file into my Artifactory server from the command line. I'm doing this using gradle because that is how we manage our java builds. However, this artifact is an NDK/JNI build artifact, and does not use gradle.
So I just need the simplest gradle script to do the deploy. Something equivalent to:
scp <file> <remote>
I am currently trying to use the artifactory plugin, and am having little luck in locating a reference for the plugin.
curl POST did not work for me . PUT worked correctly . The usage is
curl -X PUT $SERVER/$PATH/$FILE --data-binary #localfile
example :
$ curl -v --user username:password --data-binary #local-file -X PUT "http://<artifactory server >/artifactory/abc-snapshot-local/remotepath/remotefile"
Instead of using the curl command, I recommend using the jfrog CLI.
Download from here - https://www.jfrog.com/getcli/ and use the following command (make sure the file is executable) -
./jfrog rt u <file-name> <upload-path>
Here is a simple example:
./jfrog rt u sample-service-1.0.0.jar libs-release-local/com/sample-service/1.0.0/
You will be prompted for credentials and the repo URL the first time.
You can do lots of other stuff with this CLI tool. Check out the detailed instructions here - https://www.jfrog.com/confluence/display/RTF/JFrog+CLI.
The documentation for the artifactory plugin can be found, as expected, in Artifactory User Guide.
Please note that it is adviced to use the newer plugin - artifactory-publish, which supports the new Gradle publishing model.
Regarding uploading from the command line, you really don't need gradle for that. You can execute a simple PUT query using CURL or any other tool.
And of course if you just want to get your file into Artifactory, you can always deploy it via the UI.
Take a look the Artifactory REST API, mostly you can't use scp command, instead use the curl command towards REST API.
$ curl -X POST $SERVER/$PATH/$FILE --data #localfile
Mostly it looks like
$ curl -X POST http://localhost:8081/artifactory/abc-snapshot-local/remotepath/remotefile --data #localfile
The scp command is only used if you really want to access the internal folder which is managed by artifactory
$ curl -v -X PUT \
--user username:password \
--upload-file <path to your file> \
http://localhost:8080/artifactory/libs-release-local/my/jar/1.0/jar-1.0.jar
Ironically, I'm answering my own question. After a couple more hours working on the problem, I found a sample project on github: https://github.com/JFrogDev/project-examples
The project even includes a straightforward bash script for doing the exact deploy/copy from the command line that I was looking for, as well as a couple of less straightforward gradle scripts.
As per official docs, You can upload any file using the following command:
curl -u username:password -T <PATH_TO_FILE> "https://<ARTIFACTORY_SERVER>/<REPOSITORY_PATH>/<TARGET_FILE>"
Note: The user should have write access to this path.