Skip to content

Commit 702730a

Browse files
authored
Update documentation (#23)
1 parent d48e41c commit 702730a

File tree

1 file changed

+63
-63
lines changed

1 file changed

+63
-63
lines changed

README.md

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,66 @@
44
![LambdaCron](./lambda-cron-diagram.png "LambdaCron")
55

66
**LambdaCron** is a serverless cron tool. It provides a way to run scheduled tasks
7-
on AWS cloud, all managed by a command line tool ([LambdaCron CLI](#lambdacron-cli)).
7+
on the AWS cloud, all managed by a command line tool ([LambdaCron CLI](#lambdacron-cli)).
88

9-
Tasks are scheduled using the same syntax for expressions as linux
9+
Tasks are scheduled using the same syntax for expressions as Linux
1010
[crontab](https://help.ubuntu.com/community/CronHowto).
1111

12-
**LambdaCron** offer 4 different type of task to run:
12+
**LambdaCron** offers 4 different types of tasks:
1313

1414
* **Queue task**: send message to AWS SQS queue.
15-
* **Lambda task**: invoke AWS lambda function.
15+
* **Lambda task**: invoke AWS Lambda function.
1616
* **Batch task**: submit AWS Batch job.
1717
* **HTTP task**: send HTTP requests (GET & POST).
1818

1919
Tasks are defined in YAML files and are stored in a S3 bucket.
2020

2121
## LambdaCron CLI
2222

23-
**LambdaCron** provide a CLI tool that allow to manage your cron tasks from you localhost,
24-
no need to access to AWS console.
25-
26-
Also it allows to run multiple environments with different settings. As many environments
27-
as desired can be set up.
23+
**LambdaCron** provides a CLI tool that allows management of your cron tasks without access
24+
to the AWS Console. It also allows creation of multiple environments with different settings.
2825

2926
### Settings
3027

31-
Custom settings for environments are set in a YAML file located in user home, it must be
32-
called: **~/.lambda-cron.yml**.
28+
Custom settings for environments are set in a YAML-formatted configuration file located in the
29+
user home directory, and must be named **~/.lambda-cron.yml**.
3330

3431
There are 3 levels of preferences for settings:
3532

3633
* Environment: Custom values for an specific environment.
3734
* Global: Custom values that will have effect to all environments created.
3835
* Default: Default values in case no custom values are specified (by environment or globally)
3936

40-
Highest level of preference is *Environment*, followed by *Global* and finally *Default*. Each option
37+
Highest level of preference is *Environment*, followed by *Global* and finally *Default*. Each option
4138
in the settings can set the value from different levels. Higher level of preference overwrite lower levels.
4239

43-
Settings are saved in a YAML file. Each environment is defined with a root key in the YAML,
44-
global settings are identified with the key *global*.
40+
Each environment is defined with a root key in the YAML, while global settings are identified with the
41+
key *global*.
4542

4643
Options available:
4744

4845
#### bucket
4946

50-
Name of the bucket where lambda function code will be hosted and tasks stored.
47+
Name of the bucket where Lambda function code will be hosted and tasks stored.
5148

5249
```yaml
5350
bucket: 'my-custom-bucket-name'
5451
```
5552
56-
You can use the pattern **{environment}** in the string for the bucket, it will
53+
You can use the macro, **{environment}**, in the string for the bucket, and it will
5754
be replaced by the environment name.
5855
59-
**Defualt**: lambda-cron-{environment}
56+
**Default**: lambda-cron-{environment}
6057
61-
The bucket will have to folders:
58+
The bucket will have two folders:
6259
6360
* code/
6461
* tasks/
6562
6663
#### every (frequency)
6764
68-
Frequency with which the lambda function that evaluate tasks will run.
69-
It indicates the frequency by **minutes OR hours** with an integer number.
65+
Frequency at which the Lambda function will execute to run tasks.
66+
It indicates the frequency in **minutes OR hours** with an integer number.
7067
It is specified with one of the following parameters:
7168
7269
* minutes
@@ -77,13 +74,13 @@ every:
7774
minutes: 5
7875
```
7976
80-
**Defualt**: every hour.
77+
**Default**: every hour.
8178
82-
More info for [frequency](#frequency)
79+
More info for [frequency](#frequency).
8380
8481
#### alarm
8582
86-
Alarm can be set up using CloudWatch metrics. It uses following parameters:
83+
Alarm can be set up using CloudWatch metrics. It uses the following parameters:
8784
8885
* enabled
8986
* email (Required if alarm is enabled).
@@ -94,17 +91,17 @@ alarm:
9491
email: my-mailing-list@email.com
9592
```
9693
97-
**Defualt**: not enabled.
94+
**Default**: disabled.
9895
9996
#### enabled
10097
101-
It allows to enabled/disabled the cron (CloudWatch event).
98+
It enables/disables the cron (CloudWatch event).
10299
103100
```yaml
104101
enabled: True
105102
```
106103
107-
**Defualt**: enabled.
104+
**Default**: enabled.
108105
109106
#### Example
110107
@@ -115,7 +112,7 @@ global:
115112
prod:
116113
alarm:
117114
enabled: True
118-
email: dev-alerts@domain.com
115+
email: prod-alerts@domain.com
119116
every:
120117
minutes: 5
121118

@@ -134,7 +131,7 @@ The settings for each environment will be:
134131
* bucket: my-project-cron-prod
135132
* alarm:
136133
* enabled: True
137-
* email: dev-alerts@domain.com
134+
* email: prod-alerts@domain.com
138135
* every:
139136
* minutes: 5
140137
@@ -153,14 +150,16 @@ The settings for each environment will be:
153150
* alarm:
154151
* enabled: False
155152
* email: ''
156-
153+
157154
### Commands
158155
159-
**LambdaCron** CLI use [aws-cli](https://github.com/aws/aws-cli), every command
160-
is translated into aws-cli command. AWS account should be configured for aws-cli.
161-
LambdaCron CLI allow to specify different aws-cli profiles.
156+
The **LambdaCron** CLI uses the [AWS CLI](https://github.com/aws/aws-cli), and translates
157+
every command into an AWS CLI command. The AWS account used should be configured for AWS
158+
CLI access. The LambdaCron CLI allows different AWS CLI
159+
[profiles](http://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html) to
160+
be specified.
162161
163-
Following is the list of commands available.
162+
The following is the list of commands available.
164163
165164
#### create
166165
@@ -192,7 +191,7 @@ Parameters:
192191
193192
#### stop
194193
195-
Disable LambdaCron, it won't run until it is enabled (#start command)
194+
Disable LambdaCron, and it won't run until it is enabled (#start command) again.
196195
197196
Parameters:
198197
@@ -201,7 +200,7 @@ Parameters:
201200
202201
#### invoke
203202
204-
Invoke lambda function cron manually
203+
Invoke Lambda function cron manually.
205204
206205
Parameters:
207206
@@ -210,20 +209,20 @@ Parameters:
210209
211210
#### delete
212211
213-
Delete **LambdaCron** environment from the AWS account
212+
Delete **LambdaCron** environment from the AWS account.
214213
215214
Parameters:
216215
217216
* **--environment (-e)**: Environment to work with (string)
218217
* **--delete-bucket**: Flag to indicate that the bucket must be deleted from S3 (optional)
219218
* **--aws-profile (-a)**: AWS profile to use from aws-cli (string) (optional)
220219
221-
Note: To delete de bucket it must be empty.
220+
Note: The bucket must be empty before it can be deleted.
222221
223222
#### upload-tasks
224223
225-
Upload tasks to S3 bucket to run with lambda-cron. It will sync the directory
226-
with S3 deleting tasks have been deleted from the local directory.
224+
Upload tasks to S3 bucket to be run with LambdaCron. It will sync the directory
225+
with S3, including deleting tasks have been deleted from the local directory.
227226
228227
Parameters:
229228
@@ -244,20 +243,21 @@ Parameters:
244243
245244
## Tasks
246245
247-
Tasks are defined in YAML files, each task in an independent file. Task must follow
248-
the json schema provided in this repo: [schema](./lambda_cron/schema.json).
246+
Tasks are defined in YAML files, with each task in an independent file. A task must follow
247+
the JSON schema provided in this repo: [schema](./lambda_cron/schema.json).
249248
250-
All tasks must contains following keys and values:
249+
All tasks must contain the following keys and values:
251250
252251
* **name**: task name
253252
* **expression**: crontab expression
254253
* **task**: task definition (customized for each type of tasks)
255254
256-
For each kind of task there a set of specific keys a values to set. Described bellow.
255+
Each type of task has its own set of required keys as described in the following section.
256+
257257
258258
### Queue task
259259
260-
It sends a message to a AWS SQS queue.
260+
It sends a message to an AWS SQS queue.
261261
The task definition must contains following keys:
262262
263263
* **type**: *queue*
@@ -284,10 +284,10 @@ All parameters of the function will be supported soon.
284284
### Lambda task
285285
286286
It invokes an AWS lambda functions.
287-
The task definition must contains following keys:
287+
The task definition must contain the following keys:
288288
289289
* **type**: *lambda*
290-
* **FunctionName**: Name of the lambda function to invoke (string)
290+
* **FunctionName**: Name of the Lambda function to invoke (string)
291291
* **InvokeArgs**: arguments to send (YAML/JSON)
292292
293293
``` yaml
@@ -301,12 +301,12 @@ task:
301301
output: 's3://my-data-output/performance'
302302
```
303303
304-
Function is invoked using [boto3 Lambda.Client.invoke_async](http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke_async)
304+
The function is invoked using [boto3 Lambda.Client.invoke_async](http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke_async)
305305
306306
### Batch task
307307
308-
It submits AWS Batch Jobs.
309-
The task definition must contains following keys:
308+
It submits AWS Batch jobs.
309+
The task definition must contain the following keys:
310310
311311
* **type**: *batch*
312312
* **jobName**: name to assign to the job (string)
@@ -324,12 +324,12 @@ task:
324324
```
325325
326326
It is a wrapper for [boto3 Batch.Client.submit_job](http://boto3.readthedocs.io/en/latest/reference/services/batch.html#Batch.Client.submit_job).
327-
It means all parameters for the method can be set in the task definition.
327+
All parameters for the method can be set in the task definition.
328328
329329
### HTTP task
330330
331-
It send and HTTP request (GET or POST).
332-
The task definition must contains following keys:
331+
It sends an HTTP request (GET or POST).
332+
The task definition must contain the following keys:
333333
334334
* **type**: *http*
335335
* **method**: http method (get | post)
@@ -348,24 +348,24 @@ task:
348348
```
349349
350350
It is a wrapper over [Requests](http://docs.python-requests.org/en/master/).
351-
All http methods will be supported soon.
351+
All HTTP methods will be supported soon.
352352
353353
## Frequency
354354
355-
#### Execution time
355+
#### Execution time
356356
All tasks scheduled to run between the current event and the next event will be run immediately.
357357
358358
Example: LambdaCron runs every hour ('0 * * * *'), tasks '0 1 * * *' and '58 1 * * *' will run at the same time.
359359
360-
#### Task frequency
361-
Lambda cron will execute a task at most once invocation. This can result in a task being run fewer times than it's cron expression implies.
360+
#### Task frequency
361+
LambdaCron will execute a task at most once for each invocation. This can result in a task being run fewer times than it's cron expression implies.
362362
363-
Example: If LambdaCron runs every hour ('0 * * * *'), a task '*/15 * * * *' will only run once an hour. If LambdaCron runs every minute ('* * * * *'), a task '*/15 * * * *' will only run four times an hour.
363+
Example: If LambdaCron runs every hour ('0 * * * *'), a task '*/15 * * * *' will only run once an hour. If LambdaCron runs every minute ('* * * * *'), a task '*/15 * * * *' will only run four times an hour. You can set up LambdaCron to run more frequently than an hour if you need a task to be run more frequently.
364364
365365
#### Frequecy and Precision
366366
367367
Events are based on [AWS CloudWatch Events](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html).
368-
You can read in following [documentation](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html):
368+
You can learn about them in the [Scheduled Events documentation](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html):
369369
370370
* "The finest resolution using a Cron expression is a minute"
371371
* "Your scheduled rule is triggered within that minute, but not on the precise 0th second"
@@ -392,7 +392,7 @@ Be aware of this.
392392
$ pip install lambda-cron
393393
```
394394

395-
### Usage
395+
### Usage
396396

397397
Create your first environment (called 'test') with default settings:
398398

@@ -403,7 +403,7 @@ $ lambda-cron create --environment=test --create-bucket
403403
If you want to set some custom settings, create the setting file in the home
404404
directory of the user who is running the tool.
405405

406-
* ~/.lambda-cron.yml
406+
* `~/.lambda-cron.yml`
407407

408408
For help:
409409

@@ -419,7 +419,7 @@ $ lambda-cron create --help
419419

420420
## Development
421421

422-
To start working with **LambdaCron** you should clone the project, create a
422+
To start working with **LambdaCron** you should clone the project, create a
423423
virtualenv (optional) and install dependencies:
424424

425425
``` bash
@@ -433,8 +433,8 @@ $ ./lambda_cron/lambda-cron --help
433433

434434
## Contributing
435435

436-
Contributions are welcome. You can find open issues with some features and
436+
Contributions are welcome. You can find open issues with some features and
437437
improvements that would be good to have in **LambdaCron**.
438438

439-
Before contribute we encourage to take a look of following
439+
Before contribute we encourage to take a look of following
440440
[tips provided by GitHub](https://guides.github.com/activities/contributing-to-open-source/)

0 commit comments

Comments
 (0)