diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f27b0b26c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,110 +0,0 @@ -language: node_js -node_js: - - "6" - -sudo: false - -matrix: - include: - # test on docker+centos7 - - os: linux - compiler: clang - services: - - docker - sudo: true - dist: trusty - env: DOCKERFILE=Dockerfile.centos7 - before_install: [] - install: - - docker build -t tippecanoe-image -f ${DOCKERFILE} . - script: - - docker run -it tippecanoe-image - # test on docker+ubuntu - - os: linux - compiler: clang - services: - - docker - sudo: true - dist: trusty - env: DOCKERFILE=Dockerfile - before_install: [] - install: - - docker build -t tippecanoe-image -f ${DOCKERFILE} . - script: - - docker run -it tippecanoe-image - # debug+integer-santizer build - - os: linux - compiler: clang - env: CLANG_VERSION='3.8.0' BUILDTYPE=Debug CC="clang-3.8" CXX="clang++-3.8" CXXFLAGS="-fsanitize=integer" CFLAGS="-fsanitize=integer" LDFLAGS="-fsanitize=integer" - addons: - apt: - sources: ['ubuntu-toolchain-r-test' ] - packages: [ 'libstdc++6','libstdc++-5-dev' ] - # debug+leak+address-sanitizer build - - os: linux - compiler: clang - env: CLANG_VERSION='3.8.0' BUILDTYPE=Debug ASAN_OPTIONS=detect_leaks=1 CC="clang-3.8" CXX="clang++-3.8" CXXFLAGS="-fsanitize=address,undefined" CFLAGS="-fsanitize=address,undefined" LDFLAGS="-fsanitize=address,undefined" FEWER=true - addons: - apt: - sources: ['ubuntu-toolchain-r-test' ] - packages: [ 'libstdc++6','libstdc++-5-dev' ] - # coverage+debug build - - os: linux - compiler: clang - env: CLANG_VERSION='3.8.0' BUILDTYPE=Debug CC="clang-3.8" CXX="clang++-3.8" CXXFLAGS="--coverage" CFLAGS="--coverage" LDFLAGS="--coverage" - after_script: - - mason install llvm-cov 3.9.1 - - mason link llvm-cov 3.9.1 - - which llvm-cov - - curl -S -f https://codecov.io/bash -o codecov - - chmod +x codecov - - ./codecov -x "llvm-cov gcov" -Z - addons: - apt: - sources: ['ubuntu-toolchain-r-test' ] - packages: [ 'libstdc++6','libstdc++-5-dev' ] - # release+linux+g++ - - os: linux - compiler: gcc - env: BUILDTYPE=Release CC="gcc-4.9" CXX="g++-4.9" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: [ 'g++-4.9' ] - # release+linux+clang++ - - os: linux - compiler: clang - env: CLANG_VERSION='3.8.0' BUILDTYPE=Release CC="clang-3.8" CXX="clang++-3.8" - addons: - apt: - sources: ['ubuntu-toolchain-r-test' ] - packages: [ 'libstdc++6','libstdc++-5-dev' ] - # release+osx - - os: osx - compiler: clang - env: BUILDTYPE=Release - # debug+osx - - os: osx - compiler: clang - env: BUILDTYPE=Debug - -before_install: - - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps" - - export PATH=${DEPS_DIR}/bin:${PATH} && mkdir -p ${DEPS_DIR} - - | - if [[ ${CLANG_VERSION:-false} != false ]]; then - export CCOMPILER='clang' - export CXXCOMPILER='clang++' - CLANG_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/clang/${CLANG_VERSION}.tar.gz" - travis_retry wget --quiet -O - ${CLANG_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR} - fi - -install: - - BUILDTYPE=${BUILDTYPE} make -j - -script: - - npm install geobuf - - if [ -n "${FEWER}" ]; then - BUILDTYPE=${BUILDTYPE} make fewer-tests; else - BUILDTYPE=${BUILDTYPE} make test geobuf-test; - fi diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ba2e8e304..000000000 --- a/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM ubuntu:22.04 AS tippecanoe-builder - -RUN apt-get update \ - && apt-get -y install make gcc g++ libsqlite3-dev zlib1g-dev - -COPY . /tmp/tippecanoe-src -WORKDIR /tmp/tippecanoe-src - -RUN make - -CMD make test - -# Using multistage build reduces the docker image size by alot by only copying the needed binaries -FROM ubuntu:22.04 -RUN apt-get update \ - && apt-get -y install libsqlite3-0 \ - && rm -rf /var/lib/apt/lists/* -COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tippecanoe* /usr/local/bin/ -COPY --from=tippecanoe-builder /tmp/tippecanoe-src/tile-join /usr/local/bin/ -WORKDIR /app diff --git a/Dockerfile.centos7 b/Dockerfile.centos7 deleted file mode 100644 index 7a684f6f4..000000000 --- a/Dockerfile.centos7 +++ /dev/null @@ -1,15 +0,0 @@ -FROM centos:centos8 - -RUN yum install -y make sqlite-devel zlib-devel bash git gcc-c++ - -# Create a directory and copy in all files -RUN mkdir -p /tmp/tippecanoe-src -WORKDIR /tmp/tippecanoe-src -COPY . /tmp/tippecanoe-src - -# Build tippecanoe -RUN make \ - && make install - -# Run the tests -CMD make test diff --git a/lambda/.gitignore b/lambda/.gitignore deleted file mode 100644 index 539f15b44..000000000 --- a/lambda/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.zip -tmp/* diff --git a/lambda/README.md b/lambda/README.md deleted file mode 100644 index f5d4b59ba..000000000 --- a/lambda/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Build the tippecanoe layer (binary) - -1. On an AWS Linux 2 instance or image: - - sudo yum update - sudo yum install git clang sqlite-devel zlib-devel - -2. Create a ZIP archive with the `tippecanoe` binary at `bin/tippecanoe` and upload as a Lambda layer -3. Copy [tippecanoe.py](tippecanoe.py) (python 3.9 runtime) -4. set the environment variable `OUTPUT_BUCKET` to your output bucket; give lambda IAM role access to input/output buckets -5. Enable ACLs on the output bucket - -```json -{ - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "AllowGet", - "Effect": "Allow", - "Action": "s3:GetObject", - "Resource": "arn:aws:s3:::protomaps-tippecanoe-test/*" - }, - { - "Sid": "AllowPut", - "Effect": "Allow", - "Action": [ - "s3:PutObject", - "s3:PutObjectAcl" - ], - "Resource": "arn:aws:s3:::protomaps-tippecanoe-test-output/*" - } - ] -} -``` \ No newline at end of file diff --git a/lambda/requirements.txt b/lambda/requirements.txt deleted file mode 100644 index 844db8a4f..000000000 --- a/lambda/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -boto3==1.20.32 -botocore==1.23.32 diff --git a/lambda/tippecanoe.py b/lambda/tippecanoe.py deleted file mode 100644 index b76e8e513..000000000 --- a/lambda/tippecanoe.py +++ /dev/null @@ -1,49 +0,0 @@ -import os -import json -import subprocess -import sys -import boto3 -from botocore import UNSIGNED -from botocore.config import Config - -# if the input bucket is publicly readable -#s3 = boto3.client('s3',config=Config(signature_version=UNSIGNED)) - -def lambda_handler(event, context): - bucket_name = event['Records'][0]['s3']['bucket']['name'] - input_key = event['Records'][0]['s3']['object']['key'] - tmpdir = '/tmp' - run_tippecanoe('tippecanoe',tmpdir,bucket_name, input_key) - return { - 'statusCode': 200, - 'body': json.dumps('Done!') - } - -# input formats: "geojsonseq", "fgb", "geobuf", "geojson", "csv" -def split_key(key): - if key.endswith(".gz"): - root, ext = os.path.splitext(key[0:-3]) - return root, ext + ".gz" - else: - return os.path.splitext(key) - -def run_tippecanoe(executable, tmpdir, bucket_name, input_key): - s3 = boto3.client('s3') - root, ext = split_key(input_key) - input_path = os.path.join(tmpdir,'input' + ext) - output_path = os.path.join(tmpdir,'output.mbtiles') - s3.download_file(bucket_name,input_key,input_path) - p = subprocess.Popen([executable,'-o',output_path,input_path,'--force','-u','-U','5'],stderr=subprocess.PIPE) - for line in p.stderr: - try: - j = json.loads(line) - s3.put_object(Body=json.dumps(j),Bucket=os.environ['OUTPUT_BUCKET'],Key=root + ".progress",ACL="public-read",ContentType="application/json",ContentDisposition="inline") - except json.decoder.JSONDecodeError: - pass - s3.upload_file(output_path,os.environ['OUTPUT_BUCKET'],root + ".mbtiles") - -if __name__ == "__main__": - tmpdir = 'tmp' - bucket_name = sys.argv[1] - input_key = sys.argv[2] - run_tippecanoe('../tippecanoe', tmpdir, bucket_name, input_key) diff --git a/lambda/tippecanoe_test.py b/lambda/tippecanoe_test.py deleted file mode 100644 index a8ce663b8..000000000 --- a/lambda/tippecanoe_test.py +++ /dev/null @@ -1,26 +0,0 @@ -from tippecanoe import split_key -import unittest - -class TestTippecanoe(unittest.TestCase): - def test_basic(self): - root, ext = split_key("file.json") - self.assertEqual(root,"file") - self.assertEqual(ext,".json") - - def test_basic_gz(self): - root, ext = split_key("file.csv.gz") - self.assertEqual(root,"file") - self.assertEqual(ext,".csv.gz") - - def test_nested_key(self): - root, ext = split_key("dir/file.fgb") - self.assertEqual(root,"dir/file") - self.assertEqual(ext,".fgb") - - def test_nested_key_gz(self): - root, ext = split_key("dir/file.geojsonseq.gz") - self.assertEqual(root,"dir/file") - self.assertEqual(ext,".geojsonseq.gz") - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/lambda/tmp/.gitkeep b/lambda/tmp/.gitkeep deleted file mode 100644 index e69de29bb..000000000