8000 release version 0.10.0 · localstack/localstack@0c65f16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c65f16

Browse files
committed
release version 0.10.0
1 parent 4e7eb8e commit 0c65f16

File tree

5 files changed

+75
-46
lines changed

5 files changed

+75
-46
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN mkdir -p localstack/utils/kinesis/ && mkdir -p localstack/services/ && \
1313
touch localstack/__init__.py localstack/utils/__init__.py localstack/services/__init__.py localstack/utils/kinesis/__init__.py
1414
ADD localstack/constants.py localstack/config.py localstack/
1515
ADD localstack/services/install.py localstack/services/
16-
ADD localstack/utils/common.py localstack/utils/
16+
ADD localstack/utils/common.py localstack/utils/bootstrap.py localstack/utils/
1717
ADD localstack/utils/kinesis/ localstack/utils/kinesis/
1818
ADD localstack/ext/ localstack/ext/
1919

README.md

Lines changed: 59 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ any longer.
2626

2727
# Overview
2828

29-
*LocalStack* spins up the following core Cloud APIs on your local machine:
29+
LocalStack spins up the following core Cloud APIs on your local machine:
3030

3131
* **API Gateway** at http://localhost:4567
3232
* **Kinesis** at http://localhost:4568
@@ -53,71 +53,64 @@ any longer.
5353
* **IAM** at http://localhost:4593
5454
* **EC2** at http://localhost:4597
5555

56-
Additionally, *LocalStack* provides a powerful set of tools to interact with the cloud services, including
56+
Additionally, LocalStack provides a powerful set of tools to interact with the cloud services, including
5757
a fully featured KCL Kinesis client with Python binding, simple setup/teardown integration for nosetests, as
5858
well as an Environment abstraction that allows to easily switch between local and remote Cloud execution.
5959

60-
## Why *LocalStack*?
60+
## Why LocalStack?
6161

62-
*LocalStack* builds on existing best-of-breed mocking/testing tools, most notably
62+
LocalStack builds on existing best-of-breed mocking/testing tools, most notably
6363
[kinesalite](https://github.com/mhart/kinesalite)/[dynalite](https://github.com/mhart/dynalite)
6464
and [moto](https://github.com/spulec/moto). While these tools are *awesome* (!), they lack functionality
65-
for certain use cases. *LocalStack* combines the tools, makes them interoperable, and adds important
65+
for certain use cases. LocalStack combines the tools, makes them interoperable, and adds important
6666
missing functionality on top of them:
6767

68-
* **Error injection:** *LocalStack* allows to inject errors frequently occurring in real Cloud environments,
68+
* **Error injection:** LocalStack allows to inject errors frequently occurring in real Cloud environments,
6969
for instance `ProvisionedThroughputExceededException` which is thrown by Kinesis or DynamoDB if the amount of
7070
read/write throughput is exceeded.
71-
* **Isolated processes**: All services in *LocalStack* run in separate processes. The overhead of additional
71+
* **Isolated processes**: All services in LocalStack run in separate processes. The overhead of additional
7272
processes is negligible, and the entire stack can easily be executed on any developer machine and CI server.
7373
In moto, components are often hard-wired in RAM (e.g., when forwarding a message on an SNS topic to an SQS queue,
74-
the queue endpoint is looked up in a local hash map). In contrast, *LocalStack* services live in isolation
74+
the queue endpoint is looked up in a local hash map). In contrast, LocalStack services live in isolation
7575
(separate processes available via HTTP), which fosters true decoupling and more closely resembles the real
7676
cloud environment.
77-
* **Pluggable services**: All services in *LocalStack* are easily pluggable (and replaceable), due to the fact that
77+
* **Pluggable services**: All services in LocalStack are easily pluggable (and replaceable), due to the fact that
7878
we are using isolated processes for each service. This allows us to keep the framework up-to-date and select
7979
best-of-breed mocks for each individual service.
8080

8181

8282
## Requirements
8383

84-
* `make`
8584
* `python` (both Python 2.x and 3.x supported)
8685
* `pip` (python package manager)
87-
* `npm` (node.js package manager)
88-
* `java`/`javac` (Java 8 runtime environment and compiler)
89-
* `mvn` (Maven, the build system for Java)
86+
* `Docker`
9087

9188
## Installing
9289

93-
The easiest way to install *LocalStack* is via `pip`:
90+
The easiest way to install LocalStack is via `pip`:
9491

9592
```
9693
pip install localstack
9794
```
9895

99-
Once installed, run the infrastructure using the following command:
100-
```
101-
localstack start
102-
```
103-
104-
**Note**: Please do **not** use `sudo` or the `root` user - *LocalStack*
105-
should be installed and started entirely under a local non-root user.
106-
If you have problems with permissions in MacOS X Sierra,
107-
install with `pip install --user localstack`
96+
**Note**: Please do **not** use `sudo` or the `root` user - LocalStack
97+
should be installed and started entirely under a local non-root user. If you have problems
98+
with permissions in MacOS X Sierra, install with `pip install --user localstack`
10899

109100
## Running in Docker
110101

111-
You can also spin up *LocalStack* in Docker:
102+
By default, LocalStack gets started inside a Docker container using this command:
112103

113104
```
114-
localstack start --docker
105+
localstack start
115106
```
116107

117108
(Note that on MacOS you may have to run `TMPDIR=/private$TMPDIR localstack start --docker` if
118109
`$TMPDIR` contains a symbolic link that cannot be mounted by Docker.)
119110

120-
Or using docker-compose (you need to clone the repository first, currently requires docker-compose version 2.1+):
111+
### Using `docker-compose`
112+
113+
You can also use the `docker-compose.yml` file from the repository and use this command (currently requires `docker-compose` version 2.1+):
121114

122115
```
123116
docker-compose up
@@ -151,6 +144,22 @@ services:
151144

152145
To facilitate interoperability, configuration variables can be prefixed with `LOCALSTACK_` in docker. For instance, setting `LOCALSTACK_SERVICES=s3` is equivalent to `SERVICES=s3`.
153146

147+
## Starting locally (non-Docker mode)
148+
149+
Alternatively, the infrastructure can be spun up on the local host machine (without using Docker) using the following command:
150+
151+
```
152+
localstack start --host
153+
```
154+
155+
(Note that this will require [additional dependencies](#Developing), and currently is not supported on some operating systems, including Windows.)
156+
157+
LocalStack will attempt to automatically fetch the missing dependencies when you first start it up in "host" mode; alternatively, you can use the `full` profile to install all dependencies at `pip` installation time:
158+
159+
```
160+
pip install localstack[full]
161+
```
162+
154163
## Configurations
155164

156165
You can pass the following environment variables to LocalStack:
@@ -181,7 +190,7 @@ You can pass the following environment variables to LocalStack:
181190
- `docker`: run each function invocation in a separate Docker container
182191
- `docker-reuse`: create one Docker container per function and reuse it across invocations
183192

184-
For `docker` and `docker-reuse`, if *LocalStack* itself is started inside Docker, then
193+
For `docker` and `docker-reuse`, if LocalStack itself is started inside Docker, then
185194
the `docker` command needs to be available inside the container (usually requires to run the
186195
container in privileged mode). Default is `docker`, fallback to `local` if Docker is not available.
187196
* `LAMBDA_REMOTE_DOCKER` determines whether Lambda code is copied or mounted into containers.
@@ -278,8 +287,9 @@ aws --endpoint-url=http://localhost:4568 kinesis list-streams
278287
}
279288
```
280289

281-
**NEW**: Check out [awslocal](https://github.com/localstack/awscli-local), a thin CLI wrapper that runs commands directly against *LocalStack* (no need to
282-
specify `--endpoint-url` anymore). Install it via `pip install awscli-local`, and then use it as follows:
290+
**NEW**: Check out [awslocal](https://github.com/localstack/awscli-local), a thin CLI wrapper
291+
that runs commands directly against LocalStack (no need to specify `--endpoint-url` anymore).
292+
Install it via `pip install awscli-local`, and then use it as follows:
283293

284294
```
285295
awslocal kinesis list-streams
@@ -299,7 +309,7 @@ inside your Lambda function. See [Configurations](#Configurations) section for m
299309

300310
## Integration with nosetests
301311

302-
If you want to use *LocalStack* in your integration tests (e.g., nosetests), simply fire up the
312+
If you want to use LocalStack in your integration tests (e.g., nosetests), simply fire up the
303313
infrastructure in your test setup method and then clean up everything in your teardown method:
304314

305315
```
@@ -337,7 +347,7 @@ In order to mount a local folder, ensure that `LAMBDA_REMOTE_DOCKER` is set to `
337347

338348
## Integration with Java/JUnit
339349

340-
In order to use *LocalStack* with Java, the project ships with a simple JUnit runner and a JUnit 5 extension. Take a look
350+
In order to use LocalStack with Java, the project ships with a simple JUnit runner and a JUnit 5 extension. Take a look
341351
at the example JUnit test in `ext/java`. When you run the test, all dependencies are automatically
342352
downloaded and installed to a temporary directory in your system.
343353

@@ -368,8 +378,8 @@ public class MyCloudAppTest {
368378
}
369379
```
370380

371-
Additionally, there is a version of the *LocalStack* Test Runner which runs in a docker container
372-
instead of installing *LocalStack* on the current machine. The only dependency is to have docker
381+
Additionally, there is a version of the LocalStack Test Runner which runs in a docker container
382+
instead of installing LocalStack on the current machine. The only dependency is to have docker
373383
installed locally. The test runner will automatically pull the image and start the container for the
374384
duration of the test. The container can be configured by using the @LocalstackDockerProperties annotation.
375385

@@ -396,7 +406,7 @@ public class MyDockerCloudAppTest {
396406
}
397407
```
398408

399-
The *LocalStack* JUnit test runner is published as an artifact in Maven Central.
409+
The LocalStack JUnit test runner is published as an artifact in Maven Central.
400410
Simply add the following dependency to your `pom.xml` file:
401411

402412
```
@@ -443,7 +453,7 @@ with the `--user` flag: `pip install --user localstack`
443453

444454
* If you are deploying within OpenShift, please be aware: the pod must run as `root`, and the user must have capabilities added to the running pod, in order to allow Elasticsearch to be run as the non-root `localstack` user.
445455

446-
* The environment variable `no_proxy` is rewritten by *LocalStack*.
456+
* The environment variable `no_proxy` is rewritten by LocalStack.
447457
(Internal requests will go straight via localhost, bypassing any proxy configuration).
448458

449459
* For troubleshooting LocalStack start issues, you can check debug logs by running `DEBUG=1 localstack start`
@@ -454,6 +464,17 @@ with the `--user` flag: `pip install --user localstack`
454464

455465
## Developing
456466

467+
### Requirements for developing or starting locally
468+
469+
To develop new features, or to start the stack locally (outside of Docker), the following additional tools are required:
470+
471+
* `make`
472+
* `npm` (node.js package manager)
473+
* `java`/`javac` (Java 8 runtime environment and compiler)
474+
* `mvn` (Maven, the build system for Java)
475+
476+
### Development Environment
477+
457478
If you pull the repo in order to extend/modify LocalStack, run this command to install
458479
all the dependencies:
459480

@@ -502,7 +523,7 @@ localstack web
502523

503524
## Change Log
504525

505-
* v0.10.0: Lazy loading of libraries;
526+
* v0.10.0: Lazy loading of libraries; fix handling of regions; add API multiserver; improve CPU profiling; fix ES xpack installation; add basic EventBridge support; refactor Lambda API and executor; add MessageAttributes on SNS payloads; tagging for SNS; ability to customize docker command
506527
* v0.9.6: Add API Gateway SQS proxy; fix command to push Docker image; fix Docker bridge IP configuration; fix SSL issue in dashboard infra; updates to README
507528
* v0.9.5: Reduce Docker image size by squashing; fix response body for presigned URL S3 PUT requests; fix CreateDate returned by IAM; fix account IDs for CF and SNS; fix topic checks for SMS using SNS; improve documentation around `@LocalstackDockerProperties`; add basic EC2 support; upgrade to ElasticSearch 6.7; set Last-Modified header in S3; preserve logic with uppercase event keys in Java; add support for nodejs 10.x Lambdas
508529
* v0.9.4: Fix ARNs in CloudFormation deployments; write stderr to file in supervisord; fix Lambda invocation times; fix canonicalization of service names when running in Docker; add support for `@Nested` in Junit5; add support for batch/transaction in DynamoDB; fix output buffering for subprocesses; assign unique ports under docker-reuse; check if topic ARN exists before publish
@@ -619,11 +640,11 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
619640

620641
## License
621642

622-
Copyright (c) 2017-2019 *LocalStack* maintainers and contributors.
643+
Copyright (c) 2017-2019 LocalStack maintainers and contributors.
623644

624645
Copyright (c) 2016 Atlassian and others.
625646

626-
This version of *LocalStack* is released under the Apache License, Version 2.0 (see LICENSE.txt).
647+
This version of LocalStack is released under the Apache License, Version 2.0 (see LICENSE.txt).
627648
By downloading and using this software you agree to the
628649
[End-User License Agreement (EULA)](doc/end_user_license_agreement).
629650

bin/localstack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!/usr/bin/env python
22

33
"""
44
Command line interface (CLI) for LocalStack.

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Lines annotated with "#extended-lib" are excluded
1+
# (1) Lines annotated with "#extended-lib" are excluded
22
# from the dependencies when we build the pip package
33

4-
# Lines annotated with "#basic-lib" are included in the basic
4+
# (2) Lines annotated with "#basic-lib" are included in the basic
55
# version of the pip package (i.e., for "pip install localstack").
66

7-
# The remaining dependencies (without markers) are only included in the
8-
# "full" version of the pip package (i.e., "pip install localstack[full]").
7+
# (3) The remaining dependencies (those without markers) are only included in
8+
# the "full" version of the pip package (i.e., "pip install localstack[full]").
99

1010
airspeed==0.5.10
1111
# Use this version until this bug is fixed: https://github.com/awslabs/amazon-kinesis-client-python/issues/99

setup.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
# parameter variables
1111
install_requires = []
12+
extra_requires = []
1213
dependency_links = []
1314
package_data = {}
1415

@@ -27,8 +28,12 @@
2728
line = re.search(r'#\s*(.*)', line).group(1)
2829
if line and line[0] != '#':
2930
# include only basic requirements here
30-
if '://' not in line and BASIC_LIB_MARKER in line and IGNORED_LIB_MARKER not in line:
31-
install_requires.append(line)
31+
if IGNORED_LIB_MARKER not in line:
32+
line = line.split(' #')[0].strip()
33+
if BASIC_LIB_MARKER in line:
34+
install_requires.append(line)
35+
else:
36+
extra_requires.append(line)
3237

3338
# copy requirements file, to make it available inside the package at runtime
3439
with open('localstack/requirements.copy.txt', 'w') as f:
@@ -64,6 +69,9 @@
6469
packages=find_packages(exclude=('tests', 'tests.*')),
6570
package_data=package_data,
6671
install_requires=install_requires,
72+
extra_requires={
73+
'full': extra_requires
74+
},
6775
dependency_links=dependency_links,
6876
test_suite='tests',
6977
license='Apache License 2.0',

0 commit comments

Comments
 (0)
0