Skip to content

Commit af80c22

Browse files
authored
Documentation cleanup, post-gogradle build changes (#1120)
* Documentation cleanup, post-gogradle build changes * Documentation cleanup, post-gogradle build changes * Documentation cleanup, post-gogradle build changes * Documentation cleanup, post-gogradle build changes * Update cross compile instructions for gradfle tasks
1 parent 3169ed7 commit af80c22

19 files changed

Lines changed: 168 additions & 79 deletions

README.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,57 @@ After compiling, a suitable wskdeploy binary that works for your OS platform wil
154154
155155
1. Verify your installed Gradle version is `5.5.1` (or higher)
156156
157-
- If you use Windows OS, type ```gradlew.bat -version ```.
158-
- For Unix/Linux/Mac, please type ```./gradlew -version```.
157+
- On Windows OS, type ```gradlew.bat -version ```.
158+
- On Unix/Linux/Mac, please type ```./gradlew -version```.
159159
160160
> **Note** Gradle v6 is not yet supported.
161161
162-
1. For Windows type ```gradlew.bat distDocker```. For Linux/Unix/Mac, please type ```./gradlew distDocker```. These
163-
commands will start the wskdeploy cross compile for your specific OS platform inside a Docker container.
162+
1. Cross-compile binaries for all supported Operating Systems and Architectures:
164163
165-
1. After build success, you should find a correct binary under current /bin dir of you openwhisk-deploy clone dir.
164+
- On Windows, type ```gradlew.bat goBuild```
165+
- On Linux/Unix/Mac, please type ```./gradlew goBuild```.
166166
167-
If you would like to build the binaries available for all the operating systems and architectures, run the following command:
167+
1. Upon a successful build, all binaries can be found within the `./build` directory of your project:
168168
169-
```sh
170-
$ ./gradlew distDocker -PcrossCompileWSKDEPLOY=true
171-
```
169+
```sh
170+
$ ls build
171+
darwin-amd64 linux-amd64 linux-arm64 linux-s390x windows-amd64
172+
linux-386 linux-arm linux-ppc64le windows-386
173+
```
172174
173-
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.
175+
#### Compiling for a single OS/ARCH
176+
177+
1. View gradle build tasks for supported Operating Systems and Architectures:
178+
179+
```sh
180+
./gradlew tasks
181+
```
174182
175-
### Building for Internationalization
183+
you will see build tasks for supported OS/ARCH combinations:
184+
185+
```sh
186+
Gogradle tasks
187+
--------------
188+
buildDarwinAmd64 - Custom go task.
189+
buildLinux386 - Custom go task.
190+
buildLinuxAmd64 - Custom go task.
191+
buildLinuxArm - Custom go task.
192+
buildLinuxArm64 - Custom go task.
193+
buildLinuxPpc64le - Custom go task.
194+
buildLinuxS390x - Custom go task.
195+
buildWindows386 - Custom go task.
196+
buildWindowsAmd64 - Custom go task.
197+
```
198+
199+
> Note: The `buildWindows386` option is only supported on Golang versions less than 1.15.
200+
201+
#### Building for Internationalization
176202
177203
Please follow this process for building any changes to translatable strings:
178204
- [How to generate the file i18n_resources.go for internationalization](https://github.com/apache/openwhisk-wskdeploy/blob/master/wski18n/README.md)
179205
206+
---
207+
180208
### Running as a Go program
181209
182210
Since ```wskdeploy``` is a GoLang program, you may choose to run it using the Go utility. After building the wskdeploy binary, you can run it as follows:

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ golang {
3838
}
3939

4040
// The `gogradle` plugin was designed to work with `govendor` and `godeps` tools
41-
// We must disable its tasks that attempt to "fetch" dpendendencies
41+
// We must disable its tasks that attempt to "fetch" dependencies
4242
// into a "/vendor" directory and use them to build the project (which will fail)
4343
installDependencies.enabled = false
4444
resolveBuildDependencies.enabled = false

parsers/manifest_parser_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,9 +1924,9 @@ func TestParseYAML_param(t *testing.T) {
19241924
assert.Equal(t, false, param.Value, "Get param value failed.")
19251925
case "inline0":
19261926
assert.Equal(t, 456.423, param.Value, "Get param value failed.")
1927-
case "inlin10":
1927+
case "inline10":
19281928
assert.Equal(t, nil, param.Value, "Get param value failed.")
1929-
case "inlin11":
1929+
case "inline11":
19301930
assert.Equal(t, true, param.Value, "Get param value failed.")
19311931
case "expand1":
19321932
assert.Equal(t, nil, param.Value, "Get param value failed.")

specification/html/spec_actions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
## Actions
2121

2222
#### Subsections
23+
2324
- [Fields](#fields)
2425
- [Requirements](#requirements)
2526
- [Notes](#notes)
@@ -32,6 +33,7 @@
3233
The Action entity schema contains the necessary information to deploy an OpenWhisk function and define its deployment configurations, inputs and outputs.
3334

3435
### Fields
36+
3537
| Key Name | Required | Value Type | Default | Description |
3638
|:---|:---|:---|:---|:---|
3739
| version | no | [version](spec_parameter_types.md#openwhisk-types) | N/A | The optional user-controlled version for the Action. |
@@ -78,6 +80,7 @@ The following annotations have special meanings for Actions:
7880
- When the `code` key-value is specified, the `runtime` **SHALL** be a required field.
7981

8082
#### Annotation requirements
83+
8184
- The annotation `require-whisk-auth` **SHALL** only be valid for web actions (i.e., if the `web` key or `web-export` annotation is set to `true`).
8285
- If the value of the `require-whisk-auth` annotation is an `integer` its value **MUST** be a positive integer less than or equal to the `MAX_INT` value of `9007199254740991`.
8386
- When the `web` or `web-export` key is present and set to `true` the web action's **MUST** also be marked `final`. This happens automatically when the `web` or `web-export` keys are present and set to `true`.
@@ -175,12 +178,12 @@ See the file [runtimes.json](https://github.com/apache/openwhisk/blob/master/ans
175178
the main [apache/openwhisk](https://github.com/apache/openwhisk) repository for the latest supported runtimes nad versions.
176179
177180
#### Notes
181+
178182
- **WARNING**: _For OpenWhisk project builds, the Docker image used is tagged `nightly` in Docker Hub (e.g, for GitHub pull
179183
requests). Production uses of OpenWhisk code may use different images and tagged (released) image versions._
180184
- If no value for `runtime` is supplied, the value `language:default` will be assumed.
181185
- OpenWhisk runtimes may also include additional built-in packages (or libraries) that have been determined be useful for Actions surveyed and tested by the OpenWhisk platform.
182186

183-
184187
### Recognized File extensions
185188

186189
Although it is best practice to provide a runtime value when declaring an Action, it is not required. In those cases, that a runtime is not provided, the package tooling will attempt to derive the correct runtime based upon the the file extension for the Action's function (source code file). The

specification/html/spec_apis.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
The API entity schema is used to define an OpenWhisk API within a manifest.
2323

2424
### Fields
25+
2526
<html>
2627
<table width="100%">
2728
<tr>

specification/html/spec_entity_naming_and_namespacing.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,35 @@ packages, belongs in a *namespace.*
2626

2727
The fully qualified name of any entity has the format:
2828

29-
```
29+
```sh
3030
/<namespaceName>[/<packageName>]/<entityName>
3131
```
3232

3333
The namespace is typically provided at bind-time by the user deploying the package to their chosen OpenWhisk platform provider.
3434

3535
#### Requirements
3636

37-
- The “/whisk.system“ namespace is reserved for entities that are distributed with the OpenWhisk system.
37+
- The “/whisk.system“ namespace is reserved for entities that are distributed with the OpenWhisk system.
3838

3939
### Entity Names
4040

4141
The names of all entities, including actions, triggers, rules, packages,
4242
and namespaces, are a sequence of characters that follow the following
4343
format:
4444

45-
- The first character SHALL be an alphanumeric character, a digit, or an underscore.
46-
- The subsequent characters MAY be alphanumeric, digits, spaces, or any of the following:
47-
```
48-
_, @, ., -
49-
```
45+
- The first character SHALL be an alphanumeric character, a digit, or an underscore.
46+
- The subsequent characters MAY be alphanumeric, digits, spaces, or any of the following:
47+
48+
```sh
49+
_, @, ., -
50+
```
51+
5052
- The last character SHALL NOT be a space.
5153
- The maximum name length of any entity name is 256 characters (i.e., ENTITY_NAME_MAX_LENGTH = 256).
5254

5355
Valid entity names are described with the following regular expression (Java metacharacter syntax):
5456

55-
```
57+
```sh
5658
"\A([\w]|[\w][\w@ .-]{0,${ENTITY_NAME_MAX_LENGTH - 2}}[\w@.-])\z"
5759
```
5860

specification/html/spec_intro.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ Development Kits (SDKs).
3131
The code for the Actions, along with any support services implementing *Feeds*, are packaged according to this specification to be compatible with the OpenWhisk catalog and its tooling. It also serves as a means for architects and developers to model OpenWhisk package Actions as part
3232
of full, event-driven services and applications providing the necessary information for artifact and data type validation along with package management operations.
3333

34-
### Compatibility
34+
## Compatibility
3535

3636
This specification is intended to be compatible with the following specifications:
3737

38-
- *OpenWhisk API which is defined as an OpenAPI document: *
39-
- <https://github.com/apache/openwhisk/blob/master/core/controller/src/main/resources/apiv1swagger.json>
38+
- *OpenWhisk API which is defined as an OpenAPI document:*
39+
- <https://github.com/apache/openwhisk/blob/master/core/controller/src/main/resources/apiv1swagger.json>
4040

41-
- *OpenAPI Specification when defining REST APIs and parameters:*
42-
- <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md>
41+
- *OpenAPI Specification when defining REST APIs and parameters:*
42+
- <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md>
4343

4444
<!--
4545
Bottom Navigation

specification/html/spec_maps.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ entities.
2929
```
3030

3131
##### Multi-line grammar
32+
3233
```yaml
3334
# Where ‘key_n’ is a type <string> and ‘value_n’ is type <any>.
3435
<key_1>: <value_1>

specification/html/spec_normative_refs.md

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,45 @@
1717
#
1818
-->
1919

20-
2120
<!--
2221
********************************
2322
Normative Reference
2423
********************************
2524
-->
2625
<h2>Normative References</h2>
27-
<p>&nbsp;</p>
26+
2827
<table width="100%">
2928
<tr>
30-
<th>
31-
<p>Tag</p>
32-
</th>
33-
<th>
34-
<p>Description</p>
35-
</th>
29+
<th>Tag</th>
30+
<th>Description</th>
3631
</tr>
3732
<tr>
3833
<td>
39-
<p><a>RFC2119</a></p>
34+
<p>RFC2119</p>
4035
</td>
4136
<td>
4237
<p>S. Bradner, <i>Key words for use in RFCs to Indicate Requirement Levels</i>, <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>, IETF RFC 2119, March 1997.</p>
4338
</td>
4439
</tr>
4540
<tr>
4641
<td>
47-
<p><a>YAML-1.2</a></p>
42+
<p>YAML-1.2</p>
4843
</td>
4944
<td>
5045
<p>YAML, Version 1.2, 3rd Edition, Patched at 2009-10-01, Oren Ben-Kiki, Clark Evans, Ingy dšt Net <a href="http://www.yaml.org/spec/1.2/spec.html">http://www.yaml.org/spec/1.2/spec.html</a></p>
5146
</td>
5247
</tr>
5348
<tr>
5449
<td>
55-
<p><a>YAML-TS-1.1</a></p>
50+
<p>YAML-TS-1.1</p>
5651
</td>
5752
<td>
5853
<p>Timestamp Language-Independent Type for YAML Version 1.1, Working Draft 2005-01-18, <a href="http://yaml.org/type/timestamp.html">http://yaml.org/type/timestamp.html</a></p>
5954
</td>
6055
</tr>
6156
<tr>
6257
<td>
63-
<p><a>Maven-Version</a></p>
58+
<p>Maven-Version</p>
6459
</td>
6560
<td>
6661
<p>The version type is defined with the <a href="https://maven.apache.org/index.html">Apache Maven project's</a> policy draft:</p>
@@ -69,7 +64,7 @@
6964
</tr>
7065
<tr>
7166
<td>
72-
<p><a>OpenAPI-2.0</a></p>
67+
<p>OpenAPI-2.0</p>
7368
</td>
7469
<td>
7570
<p>The OpenAPI (f.k.a. 'Swagger') specification for defining REST APIs as JSON.</p>
@@ -78,7 +73,7 @@
7873
</tr>
7974
<tr>
8075
<td>
81-
<p><a>Linux-SPDX</a></p>
76+
<p>Linux-SPDX</p>
8277
</td>
8378
<td>
8479
<p>Linux Foundation, SPDX License list</p>
@@ -87,7 +82,7 @@
8782
</tr>
8883
<tr>
8984
<td>
90-
<p><a>NPM-SPDX-Syntax</a></p>
85+
<p>NPM-SPDX-Syntax</p>
9186
</td>
9287
<td>
9388
<p>Node Package Manager (NPM) SPDX License Expression Syntax</p>
@@ -103,19 +98,15 @@
10398
-->
10499

105100
<h2>Non-normative References</h2>
106-
<p>&nbsp;</p>
101+
107102
<table width="100%">
108103
<tr>
109-
<th>
110-
<p>Tag</p>
111-
</th>
112-
<th>
113-
<p>Description</p>
114-
</th>
104+
<th>Tag</th>
105+
<th>Description</th>
115106
</tr>
116107
<tr>
117108
<td>
118-
<p><a>OpenWhisk-API</a></p>
109+
<p>OpenWhisk-API</p>
119110
</td>
120111
<td>
121112
<p>OpenWhisk REST API which is defined as an OpenAPI document.</p>
@@ -124,31 +115,31 @@
124115
</tr>
125116
<tr>
126117
<td>
127-
<p><a>GNU-units</a></p>
118+
<p>GNU-units</p>
128119
</td>
129120
<td>
130121
<p>Size-type units are based upon a subset of those defined by GNU at <a href="http://www.gnu.org/software/parted/manual/html_node/unit.html">http://www.gnu.org/software/parted/manual/html_node/unit.html</a></p>
131122
</td>
132123
</tr>
133124
<tr>
134125
<td>
135-
<p><a>RFC 6838</a></p>
126+
<p>RFC 6838</p>
136127
</td>
137128
<td>
138129
<p>Mime Type definitions in compliance with <a href="http://tools.ietf.org/html/rfc6838">RFC 6838</a>.</p>
139130
</td>
140131
</tr>
141132
<tr>
142133
<td>
143-
<p><a>RFC 7231</a></p>
134+
<p>RFC 7231</p>
144135
</td>
145136
<td>
146137
<p>HTTP 1.1. status codes are described in compliance with <a href="http://tools.ietf.org/html/rfc7231#section-6">RFC 7231</a>.</p>
147138
</td>
148139
</tr>
149140
<tr>
150141
<td>
151-
<p><a>IANA-Status-Codes</a></p>
142+
<p>IANA-Status-Codes</p>
152143
</td>
153144
<td>
154145
<p>HTTP Status codes as defined in the <a href="http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">IANA Status Code Registry</a>.</p>
@@ -159,8 +150,8 @@
159150
<p>JSON Schema Specification</p>
160151
</td>
161152
<td>
162-
<p>The built-in parameter type 'json' references this specification.</p>
163-
<p>http://json-schema.org/</p>
153+
<p>The built-in parameter type 'json' references this specification:
154+
<a href="http://json-schema.org/">http://json-schema.org/</a></p>
164155
</td>
165156
</tr>
166157
</table>

specification/html/spec_package_processing.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,22 @@
2222
This document defines two file artifacts that are used to deploy
2323
Packages to a target OpenWhisk platform; these include:
2424

25-
- ***Package Manifest file***: Contains the Package definition along
25+
- ***Package Manifest file***: Contains the Package definition along
2626
with any included Action, Trigger or Rule definitions that comprise
2727
the package. This file includes the schema of input and output data
2828
to each entity for validation purposes.
2929

30-
- ***Deployment file*** (optional): Contains the values and bindings used
30+
- ***Deployment file*** (optional): Contains the values and bindings used
3131
configure a Package to a target OpenWhisk platform provider’s
3232
environment and supply input parameter values for Packages, Actions
3333
and Triggers. This can include Namespace bindings, security and
3434
policy information.
3535

3636
#### Notes
3737

38-
- _Deployment files are optional_. Deployment can be fully accomplished
38+
- _Deployment files are optional_. Deployment can be fully accomplished
3939
with simply a Manifest File.
4040

41-
4241
### Conceptual Package creation and publishing
4342

4443
The following diagram illustrates how a developer would create OpenWhisk

0 commit comments

Comments
 (0)