commit | 8cafa35bf82c855b677770a69d0acf1f21e90de5 | [log] [tgz] |
---|---|---|
author | Matt Rutkowski <mrutkows@us.ibm.com> | Thu Feb 22 16:24:58 2018 -0600 |
committer | Priti Desai <pdesai@us.ibm.com> | Thu Feb 22 14:24:58 2018 -0800 |
tree | d5ce13b87b051d2a23ac3dc9e825b956f09fb47b | |
parent | fa9746910ac2534fe5f49545ac0376cb91dcdf47 [diff] |
Remove top-level deprecated Package schema. (#743) * Remove top-level deprecated schema. * Remove invlaid credentials unit test. * Remove Package (singular) from Project schema. * gofmt deploymentreader.go. * echo to stdout list of all .go files gofmt did not like. * Remove inegration tests that tested for Package schema. * Remove all code and yaml manifests for tests no longer needed. * remove Package form yaml schema, comment out invalid unit tests; remove interactive mode. * Gofmt after all the test changes/commented out code. * Gofmt after all the test changes/commented out code. * disable TestValidateSequenceCreation integration test as it uses 'package'. * disable TestValidateSequenceCreation integration test as it uses 'package'. * disable TestValidateSequenceCreation integration test as it uses 'package'. * Gofmt after all the test changes/commented out code. * Comment out TestDependency. * Add Issue#749 TODO for all unit tests that need conversion to 'packages'. * Add an i18n warning message for manifest with no packages. * remove incomplete/invalid unit test from manifestreader_test.go. * remove incomplete/invalid unit test from manifestreader_test.go. * fix error checking logic. * report warning if no packages found in manifest. * Fix manifest_parser_test.go basic action/runtime unit tests. * Fix manifest_parser_test.go test TestParseManifestForMultiLineParams to use 'packages'. * Fix manifest_parser_test.go test TestUnmarshalForMissingPackages. * Fix manifest_parser_test.go test TestComposePackage. * Fix manifest_parser_test.go tests TestComposeSequences and TestComposeTriggers. * Fix manifest_parser_test.go test TestComposeRules. * Fix manifest_parser_test.go test TestComposeDependencies. * Fix manifest_parser_test.go test TestBadYAMLInvalidPackageKeyInManifest. * Rewrite unit test manifest_parser_test.go: TestComposeApiRecords. * Rewrite unit test manifest_parser_test.go: TestUnmarshalForPackages. * Create reusable function testLoadParseManifest and use in tests. * Use function testLoadParseManifest in compatible unit tests. * Rewrite unit test manifest_parser_test.go: TestComposeActionsForLimits. * Rewrite unit test manifest_parser_test.go: TestComposeActionsForWebActions. * Rewrite unit test manifest_parser_test.go: TestComposeActionsForFunction. * Delete all commented out package code.
wskdeploy
wskdeploy
is a utility to help you describe and deploy any part of the OpenWhisk programming model using a Manifest file written in YAML. Use it to deploy all your OpenWhisk Packages, Actions, Triggers, and Rules using a single command!
You can use this in addition to the OpenWhisk CLI. In fact, this utility uses the OpenWhisk “Go” Client to create its HTTP REST calls for deploying and undeploying your packages.
wskdeploy
The wskdeploy utility is a GoLang program so you will first need to Download and install GoLang onto your local machine.
Make sure your $GOPATH
is defined correctly in your environment. For detailed setup of your GoLang development environment, please read How to Write Go Code.
Once your environment is setup, download wskdeploy
and its dependencies:
$ cd $GOPATH $ go get github.com/apache/incubator-openwhisk-wskdeploy # see known issues below if you get an error
Use the Go utility to build the wskdeploy
binary as follows:
$ cd src/github.com/apache/incubator-openwhisk-wskdeploy/ $ go build -o wskdeploy
If you would like to build the binary for a specific operating system, you may add the arguments GOOS and GOARCH into the Go build command. You may set
GOOS
to “linux”, “darwin” or “windows”GOARCH
to “amd64” or “386”For example, run the following command to build the binary for 64-bit Linux:
$ GOOS=linux GOARCH=amd64 go build -o wskdeploy
If you want to build with the godep tool, please execute the following commands.
$ go get github.com/tools/godep # Install the godep tool. $ godep get # Download and install packages with specified dependencies. $ godep go build -o wskdeploy # build the wskdeploy tool.
wskdeploy
After building the wskdeploy binary, you can run it as follows:
Start by verifying the utility can display the command line help:
$ ./wskdeploy --help
then try deploying an OpenWhisk Manifest and Deployment file:
$ ./wskdeploy -m tests/usecases/triggerrule/manifest.yml -d tests/usecases/triggerrule/deployment.yml
Since wskdeploy
is a GoLang program, you may choose to run it using the Go utility:
$ go run main.go --help
and deploying using the Go utility would look like:
$ go run main.go -m tests/usecases/triggerrule/manifest.yml -d tests/usecases/triggerrule/deployment.yml
Binaries of wskdeploy
are available for download on the project's GitHub release page:
For each release, we typically provide binaries built for Linux, Mac OS (Darwin) and Windows on the AMD64 architecture. However, we provide instructions on how to build your own binaries as well from source code with the Go tool. See Building the project.
If you are a Developer or Contributor, we recommend building from the latest source code from the project's master branch.
Start by creating a fork of incubator-openwhisk-wskdeploy
and then change the git origin
to point to your forked repository, as follows:
$ cd $GOPATH/src/github.com/apache/incubator-openwhisk-wskdeploy $ git remote rename origin upstream $ git remote add origin https://github.com/<your fork>/incubator-openwhisk-wskdeploy $ git fetch --all $ git branch --set-upstream-to origin/master # track master from origin now
You can now use git push
to push changes to your repository and submit pull requests.
If you don't want to bother with go installation, build, git clone etc, and you can do it with Gradle/Docker.
After compiling, a suitable wskdeploy binary that works for your OS platform will be available under /bin directory.
First you need a docker daemon running locally on your machine.
Make sure you have Java 1.7 or above installed.
Clone the wskdeploy repo with command git clone https://github.com/apache/incubator-openwhisk-wskdeploy.git
If you use Windows OS, type gradlew.bat -version
. For Unix/Linux/Mac, please type ./gradlew -version
.
Make sure you can see the correct Gradle version info on your console. Currently the expected Gradle version is 3.3.
For Windows type gradlew.bat distDocker
. For Linux/Unix/Mac, please type ./gradlew distDocker
. These commands will start the wskdeploy cross compile for your specific OS platform inside a Docker container.
After build success, you should find a correct binary under current /bin dir of you openwhisk-deploy clone dir.
If you would like to build the binaries available for all the operating systems and architectures, run the following command:
$ ./gradlew distDocker -PcrossCompileWSKDEPLOY=true
Then, you will find the binaries and their compressed packages generated under the folder bin/<os>/<arch>/
for each supported Operating System and CPU Architecture pair.
Please follow this process for building any changes to translatable strings: How to generate the file i18n_resources.go for internationalization
The “go get” command uses HTTPS with GitHub and when you attempt to “commit” code you might be prompted with your GitHub credentials. If you wish to use your SSH credentials, you may need to issue the following command to set the appropriate URL for your “origin” fork:
git remote set-url origin git@github.com:<username>/incubator-openwhisk-wskdeploy.git
you can manually change the remote (origin) url within your .git/config file:
[remote "origin"] url = git@github.com:<username>/incubator-openwhisk-wskdeploy
while there, you can verify that your upstream repository is set correctly:
[remote "upstream"] url = git@github.com:apache/incubator-openwhisk-wskdeploy
This sometimes occurs using “go get” the wskdeploy code (which indirectly invokes “git clone”). You might get this error when downloading incubator-openwhisk-wskdeploy
:
Cloning into ''$GOAPTH/src/gopkg.in/yaml.v2'... error: RPC failed; HTTP 301 curl 22 The requested URL returned error: 301 fatal: The remote end hung up unexpectedly
This is caused by newer git
versions not forwarding requests anymore. One solution is to allow forwarding for gopkg.in
$ git config --global http.https://gopkg.in.followRedirects true
Committers can find instructions on how to create tagged releases here: