Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple Dockerfile sandbox & docs #294

Merged
merged 5 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Use base image: https://github.com/keeganwitt/docker-gradle
FROM gradle:jdk11

RUN mkdir -p /app/atlas-checks
COPY . /app/atlas-checks

ENTRYPOINT ["/app/atlas-checks/gradlew"]
16 changes: 5 additions & 11 deletions docs/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ There are a couple of requirements for building and running a new Atlas Check. T
- Some form of IDE
- There are multiple editors that you can use to help you build your Atlas Check. You can use text editors like [Notepad(++)](https://notepad-plus-plus.org/), [Vim](http://www.vim.org/download.php), [Emacs](https://www.gnu.org/software/emacs/) or [Sublime](https://www.sublimetext.com). Or you can use a full integrated development environment like [Intellij Idea](https://www.jetbrains.com/idea/) or [Eclipse](https://eclipse.org).

Alternatively, use the [Dockerfile](/Dockerfile) to create a development environment. See the docker
[documentation](/docs/docker.md) for installation instructions.


### Building Check Template
Building a check template is as easy as running a very basic command using gradle:
`./gradlew buildCheck -PCheckName=CheckName`
Expand Down Expand Up @@ -226,17 +230,7 @@ The properties of each flag will contain the following items:

### Currently Available Checks

- [PoolSizeCheck](tutorials/tutorial1-PoolSizeCheck.md)
- [BuildingRoadIntersectionCheck](checks/buildingRoadIntersectionCheck.md)
- [SelfIntersectingPolylineCheck](checks/selfIntersectingPolylineCheck.md)
- [FloatingEdgeCheck](checks/floatingEdgeCheck.md)
- [RoundAboutClosedLoopCheck](checks/roundaboutClosedLoopCheck.md)
- [SharpAngleCheck](checks/sharpAngleCheck.md)
- [SinkIslandCheck](tutorials/tutorial3-SinkIslandCheck.md)
- [SnakeRoadCheck](checks/snakeRoadCheck.md)
- [DuplicateNodeCheck](checks/duplicateNodeCheck.md)
- [OrphanNodeCheck](tutorials/tutorial2-OrphanNodeCheck.md)
- [InvalidTurnRestrictionCheck](checks/invalidTurnRestrictionCheck.md)
See the [checks catalog](/docs/available_checks.md) for a list and description of available checks.

** For Best Practices around writing Atlas Checks, please view our [best practices document](bestpractices.md). **

Expand Down
42 changes: 42 additions & 0 deletions docs/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Development - Docker

Use the [Dockerfile](/Dockerfile) to build a simple Docker container for development. The base image is derived from
[docker-gradle](https://github.com/keeganwitt/docker-gradle), a simple image that contains
both gradle (v6.4) and [adoptopenjdk11](https://github.com/AdoptOpenJDK/openjdk-docker).

## Installation and setup
Create docker image (in atlas-checks root).
```bash
docker build --rm --tag checks .
```

Create a docker container from the "checks" image. By default, the container exposes the gradle
wrapper (`gradlew`) script that invokes project's latest version of gradle. With this, you can
run the following commands: `run, build, buildCheck`
```bash
docker run [image name] [gradle command]
```


## Examples
Build the project (runs unit and integration tests).
```
docker run checks clean build
```

Run the default gradle run command. This will download a example pbf from geofabrik, execute the
atlas checks specified in the default configuration, and save the results to
`/app/atlas-checks/build/example/flag`

```
docker run checks run
```

Run the gradle run command using your local directory as the source. This is useful for local
development -- as changes to to the source code will be reflected when executing the command. Also,
outputs will be stored on your local machine.
```bash
docker run --mount type=bind,src=/path/to/local/atlas-checks,dst=/app/atlas-checks checks run \
-Pchecks.local.countries=AIA \
-Pchecks.local.checkFilter=SpikyBuildingCheck
```