Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit b0b7762

Browse files
authored
Documentation updates (#73)
1 parent 990c159 commit b0b7762

File tree

5 files changed

+77
-46
lines changed

5 files changed

+77
-46
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ As a platform, RAFT is designed to host any API fuzzers that are packaged into a
1313
These can be configured and used in the system via configuration files and require no code changes to integrate.
1414

1515
### Getting Started
16-
This project is designed to run on [Azure](https://azure.microsoft.com).
16+
This project is designed to run on [Azure](https://azure.microsoft.com). See https://azure.com/free to create a free
17+
subscription and receive $200 in credits. You can run this service (and much more!)
18+
free for 30 days!
1719

1820
To deploy the service download the CLI release and run `python raft.py service deploy`. See
1921
the [documentation](docs/how-to-deploy.md) for more details.

cli/raft.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
- no dashes
3434
3535
region - Region to deploy RAFT (e.g. westus2)
36+
See the documentation on container instance region availability at
3637
https://docs.microsoft.com/en-us/azure/container-instances/container-instances-region-availability
37-
for to pick the optimal region for your deployment.
38+
to pick the optimal region for your deployment.
3839
All jobs will be deployed by default in the same
3940
region as your service deployment
4041

docs/how-to-deploy.md

Lines changed: 59 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,54 @@
22

33
The following guide should get you up and running with an instance of RAFT.
44

5-
<br/>
5+
There are two main ways you can approach setting up RAFT.
6+
- Download all requirements to your workstation and then use the RAFT CLI in a command window.
7+
- Use the Azure Portal Cloud Shell. This requires no changes to your workstation.
68

7-
### The first option is to setup all the dependencies on your workstation and use the RAFT CLI from there. The second option is to use the Azure Portal Shell. When using the portal's shell, you will only need to upload the CLI package as all required dependencies are already installed.
9+
<br/>
810

9-
## Step 1: Enable the RAFT Command Line Interface (CLI)
11+
## Step 1: Install the RAFT Command Line Interface
1012

1113
Let's start out by getting the RAFT command line interface (CLI from now on)
1214
up and running. It functions just the same on Windows and Linux clients.
1315

14-
These two steps are required if you've decided to run the CLI from your workstation:
15-
- First, you'll need to [install Python](https://www.python.org/downloads/) if
16-
you don't have it installed already; RAFT requires at least **version 3.6**.
16+
### If you are using your workstation
1717

18-
- Next, you'll need to [install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
18+
- [Install Python](https://www.python.org/downloads/) if
19+
you don't have it installed already; RAFT requires at least **version 3.6**.
20+
- [Install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
1921
if you haven't already; RAFT requires at least **version 2.12**.
2022

21-
If you've decided to use the Azure Portal Shell, keep in mind that the path to Python is `/opt/az/bin/python3`
23+
### If you are using the Cloud Shell
24+
25+
If you are going to use the Cloud Shell it is assumed that you have already acquired an Azure subscription
26+
from https://azure.com/free or you have an existing subscription.
27+
28+
Access the [Cloud Shell](https://docs.microsoft.com/en-us/azure/cloud-shell/overview) from your
29+
browser by clicking on the Cloud Shell icon.</br>
30+
![](images/cloud-shell-icon.jpg)
2231

23-
- Now download the RAFT CLI, either just the binaries or the source tree if you intend to build them from source:
32+
Or access it directly from your browser at https://shell.azure.com.
33+
When using the shell for the first time it will create a storage account. This is normal and is needed to
34+
persist data from one session to another.
2435

25-
- Get the RAFT CLI from [releases](https://github.com/microsoft/rest-api-fuzz-testing/releases)
26-
- Clone the repo at https://github.com/microsoft/raft
36+
In the cloud shell the path to Python version 3.6 `/opt/az/bin/python3`
2737

28-
- At this point, you're able to run a the one-time prep script using Python's
29-
[pip package installer](https://pypi.org/project/pip/) as follows from the root
30-
of the RAFT CLI folder:
38+
### Common install instructions
39+
40+
You will need the RAFT CLI files. You can do this in a number of ways:
41+
- Download the RAFT CLI from a specific release</br>
42+
For example:</br>
43+
`wget https://github.com/microsoft/rest-api-fuzz-testing/releases/download/v1.2/cli.zip`
44+
</br>
45+
Then run unzip `unzip cli.zip`
46+
- Clone the repo
47+
- Copy the sources
48+
49+
50+
Once you have the python CLI files, you will need to install a few dependencies using Python's
51+
[pip package installer](https://pypi.org/project/pip/) from the root
52+
of the RAFT CLI folder.
3153

3254
```javascript
3355
$ pip install -r .\requirements.txt
@@ -43,7 +65,7 @@ C:\Users\[user]\AppData\Local\Programs\Python\Python39\Scripts> pip.exe install
4365

4466
<br/>
4567

46-
- At this point, the RAFT CLI should be functional:
68+
The RAFT CLI is now functional.
4769

4870
```javascript
4971
D:\REPO\raft\cli>py raft.py --help
@@ -68,18 +90,18 @@ optional arguments:
6890

6991
## Step 2: Azure Subscription Prep
7092

71-
First, you will need an Azure subscription to host the RAFT service. If you
93+
You will need an Azure subscription to host the RAFT service. If you
7294
don't already have access to an Azure subscription, please follow
7395
[these instructions](https://docs.microsoft.com/en-us/dynamics-nav/how-to--sign-up-for-a-microsoft-azure-subscription)
74-
to sign up for one.
96+
to sign up for one, or sign up for a free subscription at https://azure.com/free.
7597

76-
Second, you must be an [owner](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles)
77-
on the target subscription to deploy RAFT, though once it's deployed you only need
98+
You must be an [owner](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles)
99+
on the subscription to deploy RAFT, though once it's deployed you only need
78100
[contributor](https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles) rights to use it.
79101

80-
Last, RAFT uses [container instances](https://azure.microsoft.com/en-us/services/container-instances/)
81-
to host running jobs; by default, Azure subscriptions are limited to 100. If your
82-
target subscription is already using container instances, or you anticipate running
102+
RAFT uses [container instances](https://azure.microsoft.com/en-us/services/container-instances/)
103+
to host running jobs; by default, Azure subscriptions are limited to 100 container instances. If your
104+
subscription is already using container instances, or you anticipate running
83105
more than 100 simultaneous jobs, you should reach out to Azure support and request
84106
they increase your [quota](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-subscription-service-limits)
85107
of this object type.
@@ -96,14 +118,15 @@ Note that only four of these are required.
96118
| `subscription` | Yes | The subscription ID (GUID) of the subscription to which to deploy an instance of the RAFT service |
97119
| `deploymentName` | Yes | The name of your deployment; we will use this as the base name for all objects we create to instantiate the RAFT service |
98120
| `region` | Yes | The [region identifier](https://azure.microsoft.com/en-us/global-infrastructure/geographies/) that is closest to your location, or that's necessary for any compliance purposes |
99-
| `metricsOptIn`* | Yes | Whether you want the service to send us anonymized usage data; we use this to improve the service and respond to errors and other problems proactively (Note: to change you choice, just update the field and redeploy) |
100-
| `isDevelop` | No | Is this deployment for developing the RAFT service? Setting this value to true will generate yaml variables for use in your build pipelines |
101-
| `useAppInsights` | No | deploy AppInsights and use it to write all service logs |
102-
| `registry`** | No | registry which stores service images. Default: mcr.microsoft.com |
121+
| `metricsOptIn`* | Yes | Whether you want the service to send us anonymized usage data; we use this to improve the service and respond to errors and other problems proactively (Note: to change you choice, just update the field and redeploy) Default: true|
122+
| `isDevelop` | No | Is this deployment for developing the RAFT service? Default: false |
123+
| `isPrivateRegistry` | No | When developing for the RAFT service, indicates a private registry is used to find images. Default: false |
124+
| `useAppInsights` | Yes | Deploy AppInsights and use it to write all service logs. Default: true |
125+
| `registry` | Yes | Registry which stores service images. Default: mcr.microsoft.com |
103126

104127
### *Telemetry
105128
*By default, we collect anonymous usage data from your RAFT instance, which helps
106-
us understand how users use RAFT and the problems they experience, which in turn
129+
us understand how users use RAFT and the problems they experience, which in turn,
107130
helps us improve the quality of the offering over time. Specifically, We do **not**
108131
collect any data about the targets and results of tools you might run. The data
109132
fields we collect are defined in the `src/Contracts/Telemetry.fs` source file. To opt-out of
@@ -146,19 +169,19 @@ deploymentName - RAFT deployment name
146169
- no dashes
147170

148171
region - Region to deploy RAFT (e.g. westus2)
149-
See https://azure.microsoft.com/en-us/global-infrastructure/regions/
150-
for a list of regions
151-
152-
isDevelop - Is this deployment for developing the RAFT service?
153-
Setting this value to true will generate yaml variables for use in your
154-
build pipelines.
172+
See the documentation on container instance region availability at
173+
https://docs.microsoft.com/en-us/azure/container-instances/container-instances-region-availability
174+
to pick the optimal region for your deployment.
175+
All jobs will be deployed by default in the same
176+
region as your service deployment
155177

156178
metricsOptIn - allow Microsoft collect anonymized metrics from the deployment.
157179

158180
useAppInsights - deploy AppInsights and use it to write all service logs
159181

160182
registry - registry which stores service images.
161183
Default: mcr.microsoft.com
184+
162185
-------------------------
163186
To apply any changes made to the defaults.json file,
164187
please run 'raft.py service deploy'
@@ -167,7 +190,7 @@ please run 'raft.py service deploy'
167190

168191
<br/>
169192

170-
Using a text editor of your choice, please update the `defaults.json` file with
193+
Using a text editor of your choice, update the `defaults.json` file with
171194
the values you determined in Step 3, and then re-run:
172195

173196
```javascript
@@ -196,6 +219,6 @@ get familiar with the output.
196219

197220
Two tools are deployed by default: [RESTler](https://github.com/microsoft/restler) and [ZAP](https://www.zaproxy.org/).
198221

199-
You can see their configuration under the `cli/raft-tools/tools` folder.
222+
You can see how they are configured by looking at the configuration files under the `cli/raft-tools/tools` folder.
200223

201-
See an explanation of the `config.json` file in [How a job executes](how-it-works/how-a-job-executes.md).
224+
See an explanation of the `config.json` file in [How to onboard a tool](how-to-onboard-a-tool.md).

docs/images/cloud-shell-icon.jpg

5.99 KB
Loading

docs/raft-restler-relationship.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ In order to provide a consistent platform for supporting multiple test tools the
66
RAFT supports all of the same configuration values that RESTler supports.
77
RESTler uses a mix of camel case and underscore parameters that it accepts as part of it's run configurations. On the other hand RAFT only uses camel case parameters. For example RESTler uses parameter `restler_custom_payload` where the same parameter is called `restlerCustomPayload` in RAFT job definition.
88

9-
RESTler documentation:
9+
You can find the RESTler documentation at
1010
https://github.com/microsoft/restler-fuzzer/tree/main/docs/user-guide
1111

12-
When using RESTler documentation for configuring RESTler tasks you can use RAFT swagger definition for paramater name conversion.
12+
When using RESTler documentation for configuring RESTler tasks use the RAFT swagger definition for paramater name conversion.
1313

14-
*https://<my-deployment>-raft-apiservice.azurewebsites.net/swagger/index.html*
14+
The RAFT swagger definition can be found using this URL : *https://\<my-deployment\>-raft-apiservice.azurewebsites.net/swagger/index.html*
1515

1616

17-
RESTler requires that IP and port number are specified in order to run a test. However, RAFT will do a DNS lookup on the host parameter, specified in the job definition file, on your behalf and fill in the IP parameter for you. RAFT also defaults the port number to 443 when using SSL and 80 when not using a secure connection. If for some reason you find that you still need to specify the IP and port number then manually provided values in TargetEndpoint configuration will override any lookup or default values.
17+
RAFT will do a DNS lookup on the host parameter, specified in the job definition file,
18+
on your behalf and fill in the IP parameter for you. RAFT also defaults the port number
19+
to 443 when using SSL and 80 when not using a secure connection. If for some reason you
20+
find that you still need to specify the IP and port number then manually provided values
21+
in TargetEndpoint configuration will override any lookup or default values.
1822

1923
## RESTler mode of opearation
2024

21-
First RESTler compiles Swagger specifications into RESTler grammar. The output of compile step can be consumed by any of the following steps: Compile, Test, Fuzz.
25+
RESTler needs to compile the Swagger specifications into RESTler grammar as a first step. The output of the compile step is then consumed by any of the following steps: Test, TestFuzzLean, Fuzz.
2226
To enable passing of data from one step to the next RAFT allows any file share in the storage account to be mounted by any task.
23-
This way RAFT jobs can be executed in a "pipeline" manner by passing the output of the Compile job as input Test, Fuzz or Compile jobs.
27+
This way RAFT jobs can be executed in a "pipeline" manner by passing the output of the Compile job as input to the Test, TestFuzzLean, or Fuzz jobs.
2428

25-
Compile job produces a job ID and a file share named the same as the job ID. This makes it possible for you to mount the output of one job as input to another.
26-
The diagram below demonstrates how to pass output from the Compile step as input to the Test step of a RESTler task.
29+
A compile job produces a job ID and a file share is created and named using the job ID.
30+
This makes it possible for you to take the output written to a file share of one job and mount it to use as input to another.
31+
The diagram below illustrates this behavior in the job definition files.
2732

2833
![RESTler ](images/restler-configs-flow.png)

0 commit comments

Comments
 (0)