├── src
├── eclipse_gis
│ ├── test
│ │ ├── __init__.py
│ │ └── test_eclipse_gis.py
│ ├── src
│ │ └── eclipse_gis
│ │ │ └── __init__.py
│ └── requirements.txt
├── export_eclipse_dataset
│ ├── .gitignore
│ ├── exiftool_cmd
│ ├── exiftool_stripped_cmd
│ ├── README.md
│ ├── generate_random_id.py
│ ├── determine_state.py
│ ├── filter_photos.py
│ └── extract_metadata_from_datastore.py
├── solar_eclipse_analysis
│ ├── eclipse_gis
│ │ └── __init__.py
│ ├── data
│ │ ├── Map_pin.png
│ │ ├── berkeley_logo.png
│ │ ├── EclipseMovie_logo.png
│ │ ├── Grey_map_withline.png
│ │ ├── logo_footer_google.png
│ │ ├── logo_footer_berkeley.png
│ │ ├── EclipseMovie_logo_crop.png
│ │ └── collaborator2_Berkeley.png
│ ├── ProductSans-Regular.ttf
│ ├── geometry.py
│ ├── README.md
│ ├── read_image_exif.py
│ ├── renumber_movie.py
│ ├── exif.py
│ ├── find_circles.py
│ └── map_util.py
└── solar_eclipse_renderer
│ ├── lune.py
│ ├── coords.py
│ ├── render_constants.py
│ └── convert_location.py
├── app-container
├── conf
│ └── requirements.txt
└── templates
│ └── Dockerfile.tmpl
├── system-test-container
├── conf
│ └── requirements.txt
├── app
│ ├── __init__.py
│ ├── tests
│ │ └── __init__.py
│ └── run_tests
└── templates
│ ├── Dockerfile.tmpl
│ └── upload_stress_test_pod.yaml.tmpl
├── upload
├── system_tests
│ ├── conf
│ │ ├── requirements.txt
│ │ └── test-supervisor.conf
│ ├── app
│ │ ├── __init__.py
│ │ ├── tests
│ │ │ └── __init__.py
│ │ └── main.py
│ └── templates
│ │ └── Dockerfile.tmpl
├── server
│ ├── README.md
│ ├── app
│ │ ├── __init__.py
│ │ ├── backend
│ │ │ └── __init__.py
│ │ └── main.py
│ ├── tests
│ │ ├── __init__.py
│ │ ├── backend
│ │ │ └── __init__.py
│ │ ├── run_tests
│ │ └── upload_server_test_base.py
│ └── templates
│ │ └── Dockerfile.tmpl
├── daemon
│ ├── app
│ │ └── __init__.py
│ ├── templates
│ │ └── Dockerfile.tmpl
│ └── tests
│ │ └── run_tests
├── nginx
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── test_pod.yaml.tmpl
├── static-nginx
├── app
│ └── static
│ │ ├── README.md
│ │ ├── src
│ │ ├── movie-id.js
│ │ ├── simulator
│ │ │ └── img
│ │ │ │ ├── sun.png
│ │ │ │ ├── background.png
│ │ │ │ ├── background_dark.png
│ │ │ │ └── background_dark_nostars.png
│ │ ├── string-endswith-polyfill.js
│ │ ├── behaviors
│ │ │ └── eclipse-debug-logger.html
│ │ ├── eclipse-view404.html
│ │ ├── shared-styles.html
│ │ ├── eclipse-icons.html
│ │ ├── array-findindex-polyfill.js
│ │ └── array-includes-polyfill.js
│ │ ├── images
│ │ ├── bhlogo.jpg
│ │ ├── favicon.ico
│ │ ├── 01_Home_01.jpg
│ │ ├── 01_Home_03.png
│ │ ├── 01_Home_04.png
│ │ ├── 01_Home_05.png
│ │ ├── resources-1.png
│ │ ├── 02_Eclipse_04.png
│ │ ├── camera_gps-01.png
│ │ ├── camera_only-01.png
│ │ ├── camera_only-02.png
│ │ ├── camera_only-03.png
│ │ ├── camera_only-04.png
│ │ ├── camera_only-05.png
│ │ ├── camera_only-06.png
│ │ ├── 03_Megamovie_04.jpg
│ │ ├── Icon_arrow_down.png
│ │ ├── manifest
│ │ │ ├── favicon.ico
│ │ │ ├── favicon-16x16.png
│ │ │ ├── favicon-32x32.png
│ │ │ ├── mstile-150x150.png
│ │ │ ├── apple-touch-icon.png
│ │ │ ├── android-chrome-192x192.png
│ │ │ ├── android-chrome-256x256.png
│ │ │ ├── android-chrome-512x512.png
│ │ │ └── browserconfig.xml
│ │ ├── opengraph_image.png
│ │ ├── profile_header-01.png
│ │ ├── logo_footer_google.png
│ │ ├── collaborator1_Google.png
│ │ ├── collaborator2_Berkeley.png
│ │ ├── logo_footer_berkeley.png
│ │ └── Ribbon.svg
│ │ ├── manifest.json
│ │ ├── package.json
│ │ ├── service-worker.js
│ │ ├── polymer.json
│ │ ├── sw-precache-config.js
│ │ ├── test
│ │ └── index.html
│ │ └── sitemap.xml
├── conf
│ └── cors.json
└── templates
│ ├── Dockerfile.tmpl
│ ├── deployment.yaml.tmpl
│ └── pod.yaml.tmpl
├── admin
├── app
│ ├── conf
│ │ └── requirements.txt
│ ├── app
│ │ ├── __init__.py
│ │ └── backend
│ │ │ ├── __init__.py
│ │ │ ├── eclipse2017_admin_app.py
│ │ │ └── routes.py
│ ├── tests
│ │ ├── flask
│ │ │ ├── __init__.py
│ │ │ ├── backend
│ │ │ │ └── __init__.py
│ │ │ └── run_flask_tests
│ │ └── run_tests
│ └── templates
│ │ └── Dockerfile.tmpl
├── nginx
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── movie
├── daemon
│ ├── conf
│ │ └── requirements.txt
│ ├── app
│ │ └── __init__.py
│ ├── tests
│ │ └── run_tests
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── test-container
├── conf
│ └── requirements.txt
└── templates
│ └── Dockerfile.tmpl
├── base-container
├── requirements.txt
└── Dockerfile
├── package.json
├── nginx-lb-emulator
├── resources
│ ├── upload.conf
│ ├── cors.conf
│ ├── lb-emulator.crt
│ └── lb-emulator.key
└── templates
│ ├── Dockerfile.tmpl
│ └── nginx.conf.tmpl
├── common
├── geometry.py
├── __init__.py
├── image_sorter.py
├── find_circles.py
├── chunks.py
├── flask_users.py
├── id_token.py
├── service_account.py
├── eclipse2017_exceptions.py
├── test_common.py
├── users.py
├── cluster_points.py
├── exif.py
└── map_util.py
├── common_tests
├── __init__.py
├── install_dependencies
├── run_tests
└── image_sorter_test.py
├── geo
├── app
│ ├── app
│ │ ├── __init__.py
│ │ └── backend
│ │ │ ├── __init__.py
│ │ │ ├── eclipse2017_app.py
│ │ │ └── routes.py
│ └── templates
│ │ └── Dockerfile.tmpl
├── nginx
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── photo
├── app
│ ├── app
│ │ ├── __init__.py
│ │ └── backend
│ │ │ ├── __init__.py
│ │ │ ├── eclipse2017_photo_app.py
│ │ │ └── routes.py
│ └── templates
│ │ └── Dockerfile.tmpl
├── nginx
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── profile
├── app
│ ├── app
│ │ ├── __init__.py
│ │ └── backend
│ │ │ ├── __init__.py
│ │ │ ├── eclipse2017_app.py
│ │ │ └── routes.py
│ ├── tests
│ │ ├── flask
│ │ │ ├── __init__.py
│ │ │ ├── backend
│ │ │ │ └── __init__.py
│ │ │ └── run_flask_tests
│ │ └── run_tests
│ ├── README.md
│ └── templates
│ │ └── Dockerfile.tmpl
├── nginx
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── image-processor
├── daemon
│ ├── app
│ │ └── __init__.py
│ └── templates
│ │ └── Dockerfile.tmpl
└── templates
│ └── deployment.yaml.tmpl
├── index.yaml
├── scripts
├── run_all_tests.sh
├── upload_many_datas
├── static-build.sh
├── _ingress
├── _create_secret
├── oss_release.sh
├── _systest
├── _update
├── _push
├── _clean
├── map_point.py
├── _unittest
├── print_photos.py
├── print_processed_photos.py
├── _teardown
├── print_users.py
├── add_movie.py
├── extract_metadata.py
├── delete_processed_photos.py
├── create_user.py
├── inspect_clusters.py
├── movie_tool.py
├── get_user_ids.py
└── final_numbers_report.py
├── templates
└── config.py.tmpl
├── CONTRIBUTING.md
├── nginx-container
└── templates
│ └── Dockerfile.tmpl
├── .gitignore
├── ingress.yaml
└── datastore-emulator
└── templates
└── Dockerfile.tmpl
/src/eclipse_gis/test/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/eclipse_gis/src/eclipse_gis/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app-container/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | Flask==0.12
2 |
--------------------------------------------------------------------------------
/src/export_eclipse_dataset/.gitignore:
--------------------------------------------------------------------------------
1 | conf.sh
2 |
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/eclipse_gis/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/system-test-container/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | requests
2 |
--------------------------------------------------------------------------------
/upload/system_tests/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | requests
2 |
--------------------------------------------------------------------------------
/static-nginx/app/static/README.md:
--------------------------------------------------------------------------------
1 | # Eclipse Megamovie App
2 |
--------------------------------------------------------------------------------
/admin/app/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy
2 | scipy
3 | scikit-learn
4 |
--------------------------------------------------------------------------------
/src/eclipse_gis/requirements.txt:
--------------------------------------------------------------------------------
1 | shapely
2 | unittest2
3 | pyproj
4 |
--------------------------------------------------------------------------------
/static-nginx/app/static/src/movie-id.js:
--------------------------------------------------------------------------------
1 | var movie_id = 'qw-EFL1vxQ4';
2 |
--------------------------------------------------------------------------------
/movie/daemon/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy
2 | scipy
3 | scikit-learn
4 | matplotlib
5 |
--------------------------------------------------------------------------------
/src/export_eclipse_dataset/exiftool_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | b=$(basename $1)
3 | exiftool -c "+%.6f" -a -G1 -s $1 > /mnt/dek/tmp/$b.exif.txt
4 |
--------------------------------------------------------------------------------
/static-nginx/app/static/images/bhlogo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/bhlogo.jpg
--------------------------------------------------------------------------------
/static-nginx/app/static/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/favicon.ico
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/Map_pin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/Map_pin.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/01_Home_01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/01_Home_01.jpg
--------------------------------------------------------------------------------
/static-nginx/app/static/images/01_Home_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/01_Home_03.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/01_Home_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/01_Home_04.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/01_Home_05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/01_Home_05.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/resources-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/resources-1.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/berkeley_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/berkeley_logo.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/02_Eclipse_04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/02_Eclipse_04.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_gps-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_gps-01.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-01.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-02.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-03.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-04.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-05.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/camera_only-06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/camera_only-06.png
--------------------------------------------------------------------------------
/static-nginx/app/static/src/simulator/img/sun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/src/simulator/img/sun.png
--------------------------------------------------------------------------------
/src/export_eclipse_dataset/exiftool_stripped_cmd:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | b=$(basename $1)
3 | exiftool -c "+%.6f" -a -G1 -s $1 > /mnt/dek/exif-stripped/$b.exif.txt
4 |
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/ProductSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/ProductSans-Regular.ttf
--------------------------------------------------------------------------------
/static-nginx/app/static/images/03_Megamovie_04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/03_Megamovie_04.jpg
--------------------------------------------------------------------------------
/static-nginx/app/static/images/Icon_arrow_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/Icon_arrow_down.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/favicon.ico
--------------------------------------------------------------------------------
/static-nginx/app/static/images/opengraph_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/opengraph_image.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/profile_header-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/profile_header-01.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/EclipseMovie_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/EclipseMovie_logo.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/Grey_map_withline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/Grey_map_withline.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/logo_footer_google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/logo_footer_google.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/geometry.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | def ratio_to_decimal(ratio):
4 | return ratio.num / float(ratio.den)
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/static-nginx/app/static/images/logo_footer_google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/logo_footer_google.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/logo_footer_berkeley.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/logo_footer_berkeley.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/collaborator1_Google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/collaborator1_Google.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/collaborator2_Berkeley.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/collaborator2_Berkeley.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/logo_footer_berkeley.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/logo_footer_berkeley.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/favicon-16x16.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/favicon-32x32.png
--------------------------------------------------------------------------------
/static-nginx/app/static/src/simulator/img/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/src/simulator/img/background.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/EclipseMovie_logo_crop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/EclipseMovie_logo_crop.png
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/data/collaborator2_Berkeley.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/src/solar_eclipse_analysis/data/collaborator2_Berkeley.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/mstile-150x150.png
--------------------------------------------------------------------------------
/static-nginx/conf/cors.json:
--------------------------------------------------------------------------------
1 | [{"maxAgeSeconds": 3600, "method": ["GET", "HEAD"], "origin": ["https://prod.eclipsemega.movie"], "responseHeader": ["Content-Type"]}]
2 |
3 |
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/apple-touch-icon.png
--------------------------------------------------------------------------------
/static-nginx/app/static/src/simulator/img/background_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/src/simulator/img/background_dark.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/android-chrome-192x192.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/android-chrome-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/android-chrome-256x256.png
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/images/manifest/android-chrome-512x512.png
--------------------------------------------------------------------------------
/test-container/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | googlemaps
2 | Flask==0.12
3 | unittest2
4 | mock
5 | six
6 | httplib2
7 | selenium
8 | numpy
9 | scipy
10 | scikit-learn
11 | matplotlib
12 |
--------------------------------------------------------------------------------
/static-nginx/app/static/src/simulator/img/background_dark_nostars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/eclipse2017/HEAD/static-nginx/app/static/src/simulator/img/background_dark_nostars.png
--------------------------------------------------------------------------------
/upload/system_tests/conf/test-supervisor.conf:
--------------------------------------------------------------------------------
1 | [program:upload-system-tests]
2 | command = python main.py
3 | directory = /app
4 | user = www-data
5 | stdout_logfile=/dev/stdout
6 | stdout_logfile_maxbytes=0
7 | stderr_logfile=/dev/stderr
8 | stderr_logfile_maxbytes=0
9 |
--------------------------------------------------------------------------------
/base-container/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy
2 | google-cloud-core==0.26.0
3 | google-cloud-vision==0.26.0
4 | google-cloud-datastore==1.1.0
5 | google-cloud-storage==1.3.2
6 | google-auth
7 | oauth2client==4.0.0
8 | protobuf==3.0.0
9 | unittest2
10 | mock
11 | requests
12 | googlemaps
13 | shapely
14 | pillow
15 | exifread
16 | rawkit
17 |
18 |
--------------------------------------------------------------------------------
/static-nginx/app/static/images/manifest/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/upload/server/README.md:
--------------------------------------------------------------------------------
1 | **To run locally:**
2 |
3 | After building the docker image and completing the following, you will be able
4 | to access the app at http://localhost:8080, however note that the only endpoints
5 | are the POST only upload endpoint and the health check.
6 |
7 | ```bash
8 | $ cd upload/server
9 | $ docker run -p 8080:8080
10 | ```
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eclipse-megamovie-build",
3 | "version": "0.0.0",
4 | "description": "Eclipse Megamovie build system",
5 | "devDependencies": {
6 | "bower": "1.8",
7 | "polymer-cli": "1.1.0",
8 | "generator-polymer-init-custom-build": "2.0.1"
9 | },
10 | "engines": {
11 | "node": "6.0"
12 | },
13 | "private": true
14 | }
15 |
--------------------------------------------------------------------------------
/src/export_eclipse_dataset/README.md:
--------------------------------------------------------------------------------
1 | Create conf.sh:
2 |
3 | PROJECT_ID= # name of GCP project
4 | OUTPUT= # Directory where data will be exported
5 | IMAGE_DIR= # Directory where input image data will be cached
6 | OUTPUT_IMAGE_DIR= # Directory where processed image data will be stored
7 | EXIF_DIR= # Directory where EXIF data for images will be cached
8 |
9 | Run export_data.sh.
10 |
--------------------------------------------------------------------------------
/nginx-lb-emulator/resources/upload.conf:
--------------------------------------------------------------------------------
1 | location /services/upload {
2 | proxy_set_header Host $host;
3 | proxy_set_header X-Real-IP $remote_addr;
4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
5 | proxy_set_header X-Forwarded-Proto $scheme;
6 | proxy_pass http://upload-nginx:80/services/upload;
7 | proxy_read_timeout 90s;
8 | proxy_redirect off;
9 |
10 | client_max_body_size 100m;
11 | }
12 |
--------------------------------------------------------------------------------
/common/geometry.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 | def getRescaledDimensions(width, height, max_w, max_h):
3 | given_ratio = max_w / float(max_h)
4 | ratio = width / float(height)
5 | if ratio > given_ratio:
6 | first = max_w
7 | else:
8 | first = int(round(ratio * float(max_h)))
9 | if ratio <= given_ratio:
10 | second = max_h
11 | else:
12 | second = int(round(ratio * float(max_w)))
13 | return first, second
14 |
15 | def ratio_to_decimal(ratio):
16 | return ratio.num / float(ratio.den)
17 |
--------------------------------------------------------------------------------
/static-nginx/app/static/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Eclipse Megamovie 2017",
3 | "short_name": "Eclipse Megamovie",
4 | "start_url": "/?homescreen=1",
5 | "display": "standalone",
6 | "theme_color": "#3f51b5",
7 | "background_color": "#3f51b5",
8 | "icons": [
9 | {
10 | "src": "images/manifest/android-chrome-192x192.png",
11 | "sizes": "192x192",
12 | "type": "image/png"
13 | },
14 | {
15 | "src": "\/images\/icons\/android-chrome-256x256.png",
16 | "sizes": "256x256",
17 | "type": "image\/png"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/common/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/admin/app/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/common_tests/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/geo/app/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/photo/app/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/movie/daemon/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/profile/app/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/daemon/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/server/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/admin/app/app/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/admin/app/tests/flask/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/geo/app/app/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/photo/app/app/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/profile/app/app/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/profile/app/tests/flask/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/server/tests/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/system_tests/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/image-processor/daemon/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/static-nginx/app/static/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "eclipse-megamovie",
3 | "version": "0.0.1",
4 | "description": "Eclipse Megamovie site",
5 | "license": "http://polymer.github.io/LICENSE.txt",
6 | "scripts": {
7 | "build": "gulp"
8 | },
9 | "devDependencies": {
10 | "bower-locker": "^1.0.7",
11 | "del": "^2.2.1",
12 | "gulp": "gulpjs/gulp#4.0",
13 | "gulp-if": "^2.0.1",
14 | "gulp-imagemin": "^3.0.1",
15 | "merge-stream": "^1.0.0",
16 | "plylog": "^0.4.0",
17 | "polymer-build": "^0.4.0",
18 | "polymer-cli": "^1.0.0"
19 | },
20 | "engines": {
21 | "node": ">=4.0"
22 | },
23 | "private": true
24 | }
25 |
--------------------------------------------------------------------------------
/system-test-container/app/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/server/app/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/server/tests/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/admin/app/tests/flask/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/profile/app/tests/flask/backend/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/system-test-container/app/tests/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/upload/system_tests/app/tests/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
--------------------------------------------------------------------------------
/static-nginx/app/static/src/string-endswith-polyfill.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/"
4 | */
5 | if (!String.prototype.endsWith) {
6 | String.prototype.endsWith = function(searchString, position) {
7 | var subjectString = this.toString();
8 | if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
9 | position = subjectString.length;
10 | }
11 | position -= searchString.length;
12 | var lastIndex = subjectString.lastIndexOf(searchString, position);
13 | return lastIndex !== -1 && lastIndex === position;
14 | };
15 | }
--------------------------------------------------------------------------------
/index.yaml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | indexes:
17 | - kind: "Photo"
18 | properties:
19 | - name: "image_bucket"
20 | - name: "num_reviews"
21 |
--------------------------------------------------------------------------------
/admin/app/tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo; echo "Running admin flask application tests...";
18 | cd flask
19 | ./run_flask_tests
20 |
--------------------------------------------------------------------------------
/static-nginx/app/static/images/Ribbon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/profile/app/tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo; echo "Running profile flask application tests...";
18 | cd flask
19 | ./run_flask_tests
20 |
--------------------------------------------------------------------------------
/scripts/run_all_tests.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2017 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | failed=0
17 | pushd common_tests; ./run_tests; if [ $? != 0 ]; then failed=1; fi; popd
18 | exit $failed
19 |
--------------------------------------------------------------------------------
/static-nginx/app/static/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2016 Google Inc.
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 |
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | console.info('Service worker disabled for development, will be generated at build time.');
17 |
--------------------------------------------------------------------------------
/scripts/upload_many_datas:
--------------------------------------------------------------------------------
1 | DIR="/tmp/upload_data"
2 | NUM_UPLOADS=50
3 | IP="130.211.11.238"
4 |
5 | if ! test -d $DIR; then
6 | echo "Saving files to $DIR. These will persist once script finishes."
7 |
8 | mkdir -p $DIR
9 | python -c "a = ['a' for _ in range(25*1024*1024)]; open('$DIR/data25.txt', 'w').write(''.join(a))"
10 |
11 | I=0
12 | while [ $I -lt $NUM_UPLOADS ]; do
13 | FILE="data25-$I.txt"
14 | cp $DIR/data25.txt $DIR/$FILE
15 | I=$[ $I + 1 ]
16 | done
17 |
18 | rm -f $DIR/data25.txt
19 | fi
20 |
21 | I=0
22 | while [ $I -lt $NUM_UPLOADS ]; do
23 | FILE="data25-$I.txt"
24 | curl -d @$DIR/$FILE -H "X-Filename:$FILE" -H "Content-type:text/plain" -H "Expect:" -vv $IP/services/upload/ &
25 | I=$[ $I + 1 ]
26 | done
27 |
--------------------------------------------------------------------------------
/static-nginx/app/static/polymer.json:
--------------------------------------------------------------------------------
1 | {
2 | "entrypoint": "index.html",
3 | "shell": "src/eclipse-app.html",
4 | "fragments": [
5 | "src/eclipse-overview.html",
6 | "src/eclipse-about.html",
7 | "src/eclipse-megamovie.html",
8 | "src/eclipse-resources.html",
9 | "src/eclipse-safety.html",
10 | "src/eclipse-simulator.html",
11 | "src/eclipse-view404.html",
12 | "src/eclipse-faq.html",
13 | "src/eclipse-instructions.html"
14 | ],
15 | "sources": [
16 | "sitemap.xml",
17 | "src/**/*",
18 | "images/**/*",
19 | "bower.json"
20 | ],
21 | "extraDependencies": [
22 | "manifest.json",
23 | "bower_components/webcomponentsjs/webcomponents-lite.min.js"
24 | ],
25 | "lint" : {
26 | "rules": ["polymer-1"]
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/admin/nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 |
--------------------------------------------------------------------------------
/common/image_sorter.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | def pick_image(complete_images):
17 | complete_images.sort(key=lambda x: x["image_datetime"])
18 | return complete_images[-1]
19 |
--------------------------------------------------------------------------------
/geo/nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 |
--------------------------------------------------------------------------------
/photo/nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 |
--------------------------------------------------------------------------------
/profile/nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 |
--------------------------------------------------------------------------------
/upload/nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 |
--------------------------------------------------------------------------------
/scripts/static-build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -l
2 | set -e
3 | # Install nvm
4 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash
5 | source $HOME/.bashrc
6 | install node.js v6
7 | nvm install 6
8 | NODE_VER=v6.11.0 npm install
9 |
10 | # Cleanup
11 | rm -rf build
12 | mkdir build
13 | mkdir -p build/static-nginx
14 | mkdir -p build/static-nginx/app/static/build/default/src
15 |
16 | cp -a static-nginx/app build/static-nginx
17 | echo -e "var client_id = 'foobar';\nvar api_key = 'foobar';" > build/static-nginx/app/static/src/client-id.js
18 |
19 | pushd build/static-nginx/app/static
20 | npm install --no-spin bower
21 | npm install --no-spin polymer
22 | PATH=~/eclipse2017/node_modules/.bin:$PATH bower install
23 | polymer build --preset es5-bundled --name default
24 | popd
25 |
26 |
--------------------------------------------------------------------------------
/common/find_circles.py:
--------------------------------------------------------------------------------
1 | import cv2
2 | from common.geometry import getRescaledDimensions
3 | HD_MAX_X = 1920
4 | HD_MAX_Y = 1080
5 |
6 | def findCircles(image):
7 | image_cols, image_rows, _ = image.shape
8 |
9 | gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
10 | first, second = getRescaledDimensions(gray.shape[1], gray.shape[0], HD_MAX_X, HD_MAX_Y)
11 | gray = cv2.resize(gray, (first, second))
12 | blurred = cv2.bilateralFilter(gray, 9, 75, 75)
13 | gray = cv2.addWeighted(gray, 1.5, blurred, -0.5, 0)
14 | gray = cv2.bilateralFilter(gray, 9, 75, 75)
15 |
16 | # # detect circles in the image
17 | dp = 1
18 | c1 = 100
19 | c2 = 15
20 | circles = cv2.HoughCircles(gray, cv2.cv.CV_HOUGH_GRADIENT, dp, second / 8, param1=c1, param2=c2)
21 | if not len(circles):
22 | return None
23 | return circles[0][0]
24 |
--------------------------------------------------------------------------------
/static-nginx/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 | COPY conf/nginx /etc/nginx
20 | RUN chown -R www-data /etc/nginx
21 | ADD application.tar /app
22 |
--------------------------------------------------------------------------------
/scripts/_ingress:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 | echo "Ingressing..."
19 |
20 | if [ "$LOCAL_DEV" != "true" ]; then
21 |
22 | kubectl apply -f $PROJ_DIR/conf/tls_secret_$TARGET_ENV.yaml
23 | kubectl apply -f ingress.yaml
24 |
25 | fi
26 |
--------------------------------------------------------------------------------
/common/chunks.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | def chunks(list_, num_items):
17 | """break list_ into n-sized chunks..."""
18 | results = []
19 | for i in range(0, len(list_), num_items):
20 | results.append(list_[i:i+num_items])
21 | return results
22 |
--------------------------------------------------------------------------------
/common_tests/install_dependencies:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 |
19 | echo "Installing common dependencies..."
20 | pip install -r ../conf/requirements.txt -t lib
21 | # Google folder missing __init__ file preventing imports
22 | touch lib/google/__init__.py
23 |
--------------------------------------------------------------------------------
/common/flask_users.py:
--------------------------------------------------------------------------------
1 | from common.eclipse2017_exceptions import MissingCredentialTokenError, MissingUserError, ApplicationIdentityError
2 | from common import util
3 | from common import users
4 | import flask
5 |
6 | def authn_check(headers):
7 | try:
8 | token = users.get_id_token(headers)
9 | except MissingCredentialTokenError:
10 | return flask.Response("The request is missing a credential token.", 405)
11 | try:
12 | idinfo = util._validate_id_token(token)
13 | except ApplicationIdentityError:
14 | return flask.Response("The request id token is invalid.", 405)
15 | except ValueError:
16 | return flask.Response("The request id token is expired.", 401)
17 | try:
18 | userid = users.get_userid(idinfo)
19 | except MissingUserError:
20 | return flask.Response("The user is missing.", 405)
21 | return userid
22 |
--------------------------------------------------------------------------------
/profile/app/README.md:
--------------------------------------------------------------------------------
1 | **To run locally:**
2 | After building the docker image and completing the following, you will be able to access the app at
3 | http://localhost:8080
4 |
5 | ```bash
6 | $ cd profile
7 | $ docker run -p 8080:8080
8 | ```
9 |
10 |
11 | **Note:**
12 |
13 | The file `profile/tests/flask/test_flask_util.py` was copied from the
14 | google/oauth2client GitHub repo (https://github.com/google/oauth2client). This
15 | was included so we could subclass `FlaskOAuth2Tests` because the
16 | oauth2client/tests module is not included in the oauth2client pypi distribution.
17 |
18 |
19 | **Coming Soon**
20 |
21 | To run system tests, you will need a copy of the latest selenium chromedriver
22 | executable in your newly created profile/lib folder. You can download the driver
23 | corresponding to your platform here:
24 | http://chromedriver.storage.googleapis.com/index.html
25 |
--------------------------------------------------------------------------------
/scripts/_create_secret:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # # Create kubernetes tls secret
18 | if ! test -f $PROJ_DIR/conf/tls_secret_$TARGET_ENV.yaml; then
19 | python $PROJ_DIR/scripts/yaml_secret.py --create --save_files --yaml_output $PROJ_DIR/conf/tls_secret_$TARGET_ENV.yaml
20 | fi
21 |
--------------------------------------------------------------------------------
/common_tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # If installation fails then we do not want to run tests
18 | set -e
19 |
20 | # / (used for common. imports)
21 | PRJ_PATH=$(dirname $PWD)
22 | export PYTHONPATH=$PRJ_PATH:$PYTHONPATH
23 |
24 | python -m unittest discover . "*_test.py"
25 |
--------------------------------------------------------------------------------
/static-nginx/app/static/sw-precache-config.js:
--------------------------------------------------------------------------------
1 | /**
2 | Copyright 2016 Google Inc.
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 |
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 | */
16 | module.exports = {
17 | staticFileGlobs: [
18 | '/index.html',
19 | '/manifest.json',
20 | '/bower_components/webcomponentsjs/webcomponents-lite.min.js'
21 | ],
22 | navigateFallback: '/index.html'
23 | };
24 |
--------------------------------------------------------------------------------
/system-test-container/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX}}/base-container:latest
17 |
18 | COPY conf/requirements.txt /tmp/requirements.txt
19 | RUN pip install -r /tmp/requirements.txt
20 |
21 | ADD application.tar /app
22 | USER www-data
23 | WORKDIR /app
24 | CMD ["./run_tests"]
25 |
--------------------------------------------------------------------------------
/static-nginx/templates/deployment.yaml.tmpl:
--------------------------------------------------------------------------------
1 | apiVersion: extensions/v1beta1
2 | kind: Deployment
3 | metadata:
4 | name: static-nginx
5 | spec:
6 | replicas: 3
7 | selector:
8 | matchLabels:
9 | tier: static-nginx-backend
10 | matchExpressions:
11 | - {key: tier, operator: In, values: [static-nginx-backend]}
12 | template:
13 | metadata:
14 | labels:
15 | app: static-nginx
16 | tier: static-nginx-backend
17 | spec:
18 | containers:
19 | - name: static-nginx
20 | image: {{GCR_PREFIX}}/static-nginx
21 | ports:
22 | - containerPort: 80
23 | livenessProbe:
24 | httpGet:
25 | path: /
26 | port: 80
27 | resources:
28 | limits:
29 | cpu: 1000m
30 | memory: 128M
31 | requests:
32 | cpu: 100m
33 | memory: 128M
34 |
--------------------------------------------------------------------------------
/nginx-lb-emulator/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}nginx-container:latest
17 |
18 | RUN rm -rf /etc/nginx/*
19 |
20 | COPY resources/lb-emulator.crt etc/nginx/
21 | COPY resources/lb-emulator.key etc/nginx/
22 | COPY resources/nginx.conf etc/nginx/
23 | COPY resources/cors.conf etc/nginx/
24 |
--------------------------------------------------------------------------------
/geo/app/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}app-container:latest
17 |
18 | ADD application.tar /app
19 |
20 | USER www-data
21 | WORKDIR /app
22 | CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8080", "-t", "90", "-w", "8", "--log-level", "INFO", "--access-logfile", "/dev/stdout", "--error-logfile", "/dev/stderr"]
23 |
--------------------------------------------------------------------------------
/photo/app/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}app-container:latest
17 |
18 | ADD application.tar /app
19 |
20 | USER www-data
21 | WORKDIR /app
22 | CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8080", "-t", "90", "-w", "8", "--log-level", "INFO", "--access-logfile", "/dev/stdout", "--error-logfile", "/dev/stderr"]
23 |
--------------------------------------------------------------------------------
/profile/app/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}app-container:latest
17 |
18 | ADD application.tar /app
19 |
20 | USER www-data
21 | WORKDIR /app
22 | CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8080", "-t", "90", "-w", "8", "--log-level", "INFO", "--access-logfile", "/dev/stdout", "--error-logfile", "/dev/stderr"]
23 |
--------------------------------------------------------------------------------
/upload/system_tests/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX}}/base-container:latest
17 |
18 | COPY conf/requirements.txt /tmp/requirements.txt
19 | RUN pip install -r /tmp/requirements.txt
20 |
21 | ADD application.tar /app
22 | COPY conf/test-supervisor.conf /etc/supervisor/conf.d/test.conf
23 |
24 | CMD ["/usr/bin/supervisord", "-n"]
25 |
--------------------------------------------------------------------------------
/upload/daemon/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | ADD application.tar /app
19 |
20 | ENV DEBIAN_FRONTEND noninteractive
21 | ENV APT_LISTCHANGES_FRONTEND none
22 |
23 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
24 |
25 | WORKDIR /app
26 | USER www-data
27 |
28 | CMD ["python", "main.py"]
29 |
--------------------------------------------------------------------------------
/templates/config.py.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | GCS_BUCKET = '{{GCLOUD_PROJ}}-photos'
17 | GCS_PROCESSED_PHOTOS_BUCKET = '{{GCLOUD_PROJ}}-processed-photos'
18 | GCS_MOVIE_BUCKET = '{{GCLOUD_PROJ}}-movies'
19 | PROJECT_ID = '{{PROJECT_ID}}'
20 |
21 | UPLOAD_SERVER_RSS_MAX_USAGE = {{UPLOAD_SERVER_RSS_MAX_USAGE_BYTES}}
22 | PENDING_UPLOADS_MAX_USAGE = {{PENDING_UPLOADS_MAX_USAGE_BYTES}}
23 |
24 | CDN_HOSTNAME = '{{CDN_HOSTNAME}}'
25 |
--------------------------------------------------------------------------------
/scripts/oss_release.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2017 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 |
19 | TMPDIR=$(mktemp -d)
20 | echo "Copying git tree to $TMPDIR"
21 | git archive --format=tar --prefix=./ HEAD | (cd $TMPDIR && tar xf -)
22 | find $TMPDIR -wholename '*scripts/oss_release.sh' -prune -o -type f -exec grep -l Copyright {} \; > STOPSHIP.files
23 | if [ $? != 0 ]; then
24 | echo "Found STOPSHIP:"
25 | cat STOPSHIP.files
26 | exit 1
27 | fi
28 |
--------------------------------------------------------------------------------
/scripts/_systest:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 | echo "System testing..."
19 |
20 | if [ "$LOCAL_DEV" != "true" ]; then
21 | kubectl apply -f build/system-test-container/test_pod.yaml --record
22 | else
23 | GCR_PREFIX="gcr.io/$GCLOUD_PROJ_PREFIX${GCLOUD_PROJ_PREFIX:+"/"}$GCLOUD_PROJ"
24 | LINK="--link static-nginx"
25 | docker run -ti --link static-nginx --name system-test ${GCR_PREFIX}/system-test-container
26 | fi
27 |
--------------------------------------------------------------------------------
/scripts/_update:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 | echo "Update..."
19 |
20 | if [[ $LOCAL_DEV != true ]]; then
21 | if [[ -z $APP ]]; then
22 | echo "MUST provide an APP selector for update"
23 | exit 1
24 | fi
25 |
26 | GCR_PREFIX="gcr.io/$GCLOUD_PROJ_PREFIX${GCLOUD_PROJ_PREFIX:+"/"}$GCLOUD_PROJ"
27 | kubectl set image deployment/$DEPLOYMENT $APP=$GCR_PREFIX/$APP:$GIT_TAG
28 | fi
29 |
30 | echo "Done updating."
31 |
--------------------------------------------------------------------------------
/upload/daemon/tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo; echo "Running upload daemon tests...";
18 |
19 | # If installation fails then we do not want to run tests
20 | set -e
21 |
22 | # upload/daemon used for app. imports
23 | DAEMON_PATH=$(dirname $PWD)
24 |
25 | # / (used for common. imports)
26 | PRJ_PATH=$(dirname $(dirname $DAEMON_PATH))
27 | export PYTHONPATH=$DAEMON_PATH:$PRJ_PATH:$PYTHONPATH
28 | python -m unittest discover . "*_test.py"
29 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to contribute
2 |
3 | We'd love to accept your patches and contributions to this project. There are
4 | just a few small guidelines you need to follow.
5 |
6 | ## Contributor License Agreement
7 |
8 | Contributions to this project must be accompanied by a Contributor License
9 | Agreement. You (or your employer) retain the copyright to your contribution,
10 | this simply gives us permission to use and redistribute your contributions as
11 | part of the project. Head over to to see
12 | your current agreements on file or to sign a new one.
13 |
14 | You generally only need to submit a CLA once, so if you've already submitted one
15 | (even if it was for a different project), you probably don't need to do it
16 | again.
17 |
18 | ## Code reviews
19 |
20 | All submissions, including submissions by project members, require review. We
21 | use GitHub pull requests for this purpose. Consult [GitHub Help] for more
22 | information on using pull requests.
23 |
24 | [GitHub Help]: https://help.github.com/articles/about-pull-requests/
25 |
--------------------------------------------------------------------------------
/nginx-container/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | ENV DEBIAN_FRONTEND noninteractive
19 | ENV APT_LISTCHANGES_FRONTEND none
20 |
21 | RUN apt-get install -y --no-install-recommends nginx sudo && \
22 | service nginx stop && \
23 | mkdir -p /var/run/nginx/cache && \
24 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25 |
26 | CMD ["/usr/sbin/nginx", "-c", "/etc/nginx/nginx.conf"]
27 |
--------------------------------------------------------------------------------
/upload/server/tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo; echo "Running upload server tests...";
18 |
19 | # If installation fails then we do not want to run tests
20 | set -e
21 |
22 | # upload/server used for app. imports
23 | SERVER_PATH=$(dirname $PWD)
24 |
25 | # / (used for common. imports)
26 | PRJ_PATH=$(dirname $(dirname $SERVER_PATH))
27 |
28 | export PYTHONPATH=$SERVER_PATH:$PRJ_PATH:$PYTHONPATH
29 |
30 | python -m unittest discover . "*_test.py"
31 |
--------------------------------------------------------------------------------
/movie/daemon/tests/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo "Running upload daemon tests...";
18 |
19 | # Append directories to $PYTHONPATH
20 | # DAEMON_DIR = movie/daemon - Used for app. imports
21 | # PRJ_DIR = eclipse2017 - Used for common. imports
22 | DAEMON_DIR=$(dirname $PWD)
23 | PRJ_DIR=$(dirname $(dirname $DAEMON_DIR))
24 |
25 | export PYTHONPATH=$DAEMON_DIR:$PRJ_DIR:$PYTHONPATH
26 | export GEOS_DIR=/usr/local
27 |
28 | python -m unittest discover . "*_test.py"
29 |
--------------------------------------------------------------------------------
/upload/server/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}app-container:latest
17 |
18 | RUN apt-get install -y --no-install-recommends python-wand libmagickwand-dev && \
19 | apt-get clean && rm -rf /tmp/* /var/tmp/*
20 | ADD application.tar /app
21 |
22 | WORKDIR /app
23 | USER www-data
24 | CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8080", "-t", "600", "-w", "8", "--log-level", "INFO", "--access-logfile", "/dev/stdout", "--error-logfile", "/dev/stderr"]
25 |
--------------------------------------------------------------------------------
/app-container/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | ENV DEBIAN_FRONTEND noninteractive
19 | ENV APT_LISTCHANGES_FRONTEND none
20 |
21 | COPY conf/requirements.txt /tmp/requirements-eclipse2017.txt
22 |
23 | RUN apt-get install -y --no-install-recommends gunicorn && \
24 | pip install -r /tmp/requirements-eclipse2017.txt && \
25 | install -d -o www-data -g www-data /app/logs && \
26 | apt-get clean && rm -rf /tmp/* /var/tmp/*
27 |
--------------------------------------------------------------------------------
/image-processor/daemon/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2015 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | USER root
19 |
20 | ENV DEBIAN_FRONTEND noninteractive
21 | ENV APT_LISTCHANGES_FRONTEND none
22 | ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1
23 |
24 | RUN apt-get install -y --no-install-recommends python-opencv python-wand libmagickwand-dev libgeos-dev && \
25 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
26 |
27 | WORKDIR /app
28 | USER www-data
29 | ADD application.tar /app
30 |
31 | CMD ["python", "main.py"]
32 |
--------------------------------------------------------------------------------
/system-test-container/app/run_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2017 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 |
19 |
20 | # eclipse2017/profile/app/app
21 | APP_PATH=$(dirname $(dirname $PWD))
22 |
23 | # eclipse2017/profile/
24 | PROFILE_PATH=$(dirname $APP_PATH)
25 |
26 | # eclipse2017/
27 | PRJ_PATH=$(dirname $PROFILE_PATH)
28 | BUILD_DIR=$PRJ_PATH/build
29 |
30 | # common_tests/
31 | COMMON_TEST_PATH=$PRJ_PATH/common_tests
32 |
33 | # common_tests/lib
34 | COMMON_LIB_PATH=$COMMON_TEST_PATH/lib
35 |
36 | export PYTHONPATH=/app
37 | python -m unittest2 discover tests "*_test.py"
38 |
--------------------------------------------------------------------------------
/scripts/_push:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | set -e
18 | echo "Pushing docker images..."
19 |
20 | # command aliases
21 | PUSHCMD="gcloud docker -- push"
22 |
23 | # Gcloud values
24 | GCR_PREFIX="gcr.io/$GCLOUD_PROJ_PREFIX${GCLOUD_PROJ_PREFIX:+"/"}$GCLOUD_PROJ"
25 |
26 | IMAGES="base-container \
27 | app-container \
28 | geo-server \
29 | geo-nginx \
30 | static-nginx \
31 | system-test-container"
32 |
33 | for img in ${IMAGES}; do
34 | [[ -z $APP || $APP == $img ]] && $PUSHCMD $GCR_PREFIX/$img
35 | done
36 |
37 | echo "Done."
38 |
--------------------------------------------------------------------------------
/static-nginx/app/static/test/index.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Tests
24 |
25 |
26 |
27 |
28 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/admin/app/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}app-container:latest
17 |
18 | ADD application.tar /app
19 | COPY conf/requirements.txt /tmp/requirements.txt
20 | RUN apt-get install -y --no-install-recommends python-pip && \
21 | pip install -r /tmp/requirements.txt && \
22 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
23 |
24 | USER www-data
25 | WORKDIR /app
26 | CMD ["gunicorn", "main:app", "-b", "0.0.0.0:8080", "-t", "90", "-w", "8", "--log-level", "INFO", "--access-logfile", "/dev/stdout", "--error-logfile", "/dev/stderr"]
27 |
--------------------------------------------------------------------------------
/scripts/_clean:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | echo "Cleaning..."
18 |
19 | GCR_PREFIX="gcr.io/$GCLOUD_PROJ_PREFIX${GCLOUD_PROJ_PREFIX:+"/"}$GCLOUD_PROJ"
20 | IMAGES="nginx-lb-emulator \
21 | static-nginx \
22 | nginx-container \
23 | app-container \
24 | base-container"
25 |
26 | remove_image() {
27 | if [ "$LOCAL_DEV" != "true" ]; then
28 | docker rmi -f $GCR_PREFIX/$1
29 | else
30 | docker rmi -f $1
31 | fi
32 | }
33 |
34 | for img in $IMAGES; do
35 | [[ -z $APP || $APP == $img ]] && remove_image $img
36 | done
37 |
38 | [ -d build/ ] && rm -rf build/
39 |
--------------------------------------------------------------------------------
/src/solar_eclipse_renderer/lune.py:
--------------------------------------------------------------------------------
1 | import ephem
2 | import math
3 | deg = math.degrees
4 | def get_lune(sun, moon):
5 | r_sun=sun.size/2
6 | r_moon=moon.size/2
7 | s=math.degrees(ephem.separation((sun.az, sun.alt), (moon.az, moon.alt)))*60*60
8 |
9 | ## Calculate the size of the lune (http://mathworld.wolfram.com/Lune.html) in arcsec^2
10 | if s<(r_moon+r_sun):
11 | x = (r_sun+r_moon+s)*(r_moon+s-r_sun)*(s+r_sun-r_moon)*(r_sun+r_moon-s)
12 | lunedelta=0.25*math.sqrt(abs(x))
13 | else: ### If s>r_moon+r_sun there is no eclipse taking place
14 | lunedelta=None
15 | percent_eclipse=0
16 | if lunedelta:
17 | x = ((r_moon*r_moon)-(r_sun*r_sun)-(s*s))
18 | y = ((r_moon*r_moon)+(s*s)-(r_sun*r_sun))
19 | # Total eclipse
20 | if x/(2*r_sun*s) > 1:
21 | return 100.
22 | else:
23 | lune_area=2*lunedelta + r_sun*r_sun*(math.acos(x/(2*r_sun*s))) - r_moon*r_moon*(math.acos(y/(2*r_moon*s)))
24 | percent_eclipse=(1-(lune_area/(math.pi*r_sun*r_sun)))*100 # Calculate percentage of sun's disc eclipsed using lune area and sun size
25 | return percent_eclipse
26 | else:
27 | return 0.
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *__pycache__/
3 | *application.tar
4 | cert
5 | key
6 | conf/*
7 | *.iml
8 |
9 | build/
10 |
11 | common/service_account.json
12 | common/flask/secret_keys.py
13 | common_tests/lib/
14 | common/config.py
15 |
16 | profile/app/tests/flask/lib/
17 | profile/app/tests/js/lib/
18 | profile/nginx/app/static/third_party/node_modules/bower/package.json
19 | profile/nginx/app/static/third_party/bower_components
20 | profile/nginx/app/static/third_party/node_modules
21 | profile/app/Dockerfile
22 | profile/nginx/Dockerfile
23 | profile/nginx/conf/nginx/nginx.conf
24 | profile/deployment.yaml
25 |
26 | upload/server/app/config.py
27 | upload/test_pod.yaml
28 | upload/deployment.yaml
29 | upload/daemon/Dockerfile
30 | upload/server/app/config.py
31 | upload/server/Dockerfile
32 | upload/nginx/Dockerfile
33 | upload/nginx/conf/nginx/nginx.conf
34 | upload/system_tests/Dockerfile
35 |
36 | movie/daemon/Dockerfile
37 | movie/deployment.yaml
38 |
39 | static-nginx/Dockerfile
40 | static-nginx/deployment.yaml
41 | static-nginx/app/static/node_modules
42 | static-nginx/app/static/bower_components
43 | static-nginx/app/static/build
44 |
45 | app-container/Dockerfile
46 | nginx-container/Dockerfile
47 |
48 | /pending-uploads
49 |
--------------------------------------------------------------------------------
/nginx-lb-emulator/resources/cors.conf:
--------------------------------------------------------------------------------
1 | if ($request_method = 'OPTIONS') {
2 | add_header 'Access-Control-Allow-Origin' '*' always;
3 | add_header 'Access-Control-Allow-Methods' 'GET, DELETE, POST, PUT, OPTIONS, UPDATE, PATCH' always;
4 | #
5 | # Custom headers and headers various browsers *should* be OK with but aren't
6 | #
7 | add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-IdToken,X-UploadSessionId,X-Image-Bucket,X-CC0-Agree,X-Public-Agree' always;
8 | #
9 | # Tell client that this pre-flight info is valid for 20 days
10 | #
11 | add_header 'Access-Control-Max-Age' 1728000 always;
12 | add_header 'Content-Type' 'text/plain charset=UTF-8' always;
13 | add_header 'Content-Length' 0 always;
14 | return 204;
15 | }
16 |
17 | add_header 'Access-Control-Allow-Origin' '*' always;
18 | add_header 'Access-Control-Allow-Methods' 'GET, DELETE, POST, PUT, OPTIONS, UPDATE' always;
19 | add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-IdToken,X-UploadSessionId,X-Image-Bucket,X-CC0-Agree,X-Public-Agree' always;
20 |
--------------------------------------------------------------------------------
/common/id_token.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | import google.auth
17 | import google.auth.transport.requests
18 | import google.oauth2._client
19 |
20 | def get_id_token():
21 | # Only works w/ user credentials
22 | credentials, _ = google.auth.default()
23 |
24 | request = google.auth.transport.requests.Request()
25 | response = google.oauth2._client.refresh_grant(
26 | request, credentials.token_uri, credentials.refresh_token,
27 | credentials.client_id, credentials.client_secret)
28 |
29 | _, _, _, grant_response = response
30 | id_token = grant_response['id_token']
31 | return id_token
32 |
--------------------------------------------------------------------------------
/ingress.yaml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | apiVersion: extensions/v1beta1
17 | kind: Ingress
18 | metadata:
19 | name: eclipse2017
20 | spec:
21 | backend:
22 | serviceName: static-nginx
23 | servicePort: 80
24 | rules:
25 | - http:
26 | paths:
27 | - path: /*
28 | backend:
29 | serviceName: static-nginx
30 | servicePort: 80
31 | - path: /services/geo/*
32 | backend:
33 | serviceName: geo
34 | servicePort: 80
35 | tls:
36 | - secretName: eclipse2017
37 |
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/README.md:
--------------------------------------------------------------------------------
1 | Create conf.sh:
2 |
3 | PROJECT_ID= # name of GCP project
4 | IMAGE_BUCKET=megamovie # name of image_bucket to select images from
5 | OUTPUT= # where to write output data, filesystem needs ~1TB free space
6 | IMAGE_DIR= # directory containing all the input images
7 | PHOTO_TABLE=Photo # Name of the photo table
8 | MAP_DIR=$OUTPUT/map # where map output will be written
9 | RESCALED_DIR=$OUTPUT/rescaled # where rescaled images will be written
10 | CIRCLES_DIR=$OUTPUT/circles # where detected circles will be written
11 | CLASSIFY_DIR=$OUTPUT/classify # where cloud vision classifications will be written
12 | CREDITS_DIR=$OUTPUT/credits # where the credits output will be written
13 | MOVIE_DIR=$OUTPUT/movie # where the movie output files will be written
14 | MOVIE_RENUMBER_DIR=$OUTPUT/movie_renumber # where the renumbered movie files will be written
15 | PARTITION_DIR=$OUTPUT/partition # where thre partitioned movie files will be written
16 | FINAL_DIR=$OUTPUT/final # final directory where output files will appear
17 | SELECTED_DIR=$OUTPUT/selected # where the list of selected images will be written
18 | VIDEO_SETTINGS="-c:v libx264 -preset slow -crf 8" # video settings for movie encoding
19 |
20 | Run make_movie.sh.
21 |
--------------------------------------------------------------------------------
/nginx-lb-emulator/resources/lb-emulator.crt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDKzCCAhOgAwIBAgIJAJGGfnIBC5GAMA0GCSqGSIb3DQEBCwUAMCwxFDASBgNV
3 | BAMMC2VjbGlwc2UyMDE3MRQwEgYDVQQKDAtlY2xpcHNlMjAxNzAeFw0xNjA5MDkx
4 | OTM0MDdaFw0xNzA5MDkxOTM0MDdaMCwxFDASBgNVBAMMC2VjbGlwc2UyMDE3MRQw
5 | EgYDVQQKDAtlY2xpcHNlMjAxNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
6 | ggEBAMw0cComknAPeCd70phv4XpbPwYO33+KG3vNY6PfG/2AiBM5nq3mLAEbBf1p
7 | nBNEXkK4D7sI6tE0dyE8+vnzx0HHKV8WlMuCKWYzj+nHKrvmOQPdkjco7Z7IHK0p
8 | zK8LdQ0mI73CtoH0IC0Sf5yaZC+6y4g2CQVBq2ft2gthsfS5pTotX9SdX337MChn
9 | saLZtH70SHE/NM1W4t+7cMgUzoZkV/f4Di9dlM65Ip/h8MjDUjOtraMj/gAUAbE7
10 | 11Y67Lv+lwB4693ArC9l/4TEPwsQgWkLjBC1sxT00VKaTYC20RI1MyHuFAHceHY0
11 | 3Uvs5ipLEs5u1V2xynDzxi+/8aMCAwEAAaNQME4wHQYDVR0OBBYEFLpt2h4WQWlQ
12 | urtiu0H7qoZF7F6DMB8GA1UdIwQYMBaAFLpt2h4WQWlQurtiu0H7qoZF7F6DMAwG
13 | A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBALjJvNP2nSkkJoFVtHACWZiD
14 | UAAHR96cyo5HnbR6jwIQeJMvXVIUeBsuXk7MG5So+gOLA1wDpW7G8VAl8jh9ryus
15 | IBFQOf3EYuX4bHxiNJsOBTA/CTBLfs9yYlohPGzlA8jEJqi6XgFwuSKi/uirOYpE
16 | BXjq0Ga9XY1af0U4C5qeyoy0AYgTXvz0yXagwjvXuGPZWg+UFRXK8yfEtOefOU3V
17 | GWR39AmOy0vU7ac7DzlCmq1/PAgahqmBR3/bt7SXiX5aKOKwPgVapvnqaN5IOizm
18 | 8MW7Gvss1l5Gaqw9TCl8cpZL+ZtyL1yjnyqcwRcqxyR0GmVTLl9ViIPnTcALvo8=
19 | -----END CERTIFICATE-----
20 |
--------------------------------------------------------------------------------
/scripts/map_point.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | from eclipse_gis import eclipse_gis
17 | times, points = eclipse_gis.load_stripped_data(open("src/eclipse_gis/data/eclipse_data.txt").readlines())
18 | boundary, center = eclipse_gis.generate_polygon(points)
19 | print center
20 | eclipse_gis = eclipse_gis.EclipseGIS(boundary, center)
21 | from shapely.geometry import Point
22 | print eclipse_gis.find_nearest_point_on_line(Point(44.62, -117.13))
23 | print eclipse_gis.interpolate_nearest_point_on_line(Point(44.62, -117.13))
24 | print eclipse_gis.find_nearest_point_on_line(Point(37, -88))
25 | print eclipse_gis.interpolate_nearest_point_on_line(Point(37, -88))
26 |
--------------------------------------------------------------------------------
/src/solar_eclipse_renderer/coords.py:
--------------------------------------------------------------------------------
1 | # Copyright 2017 Google Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import math
16 |
17 | def horizontal_to_cartesian(altitude, azimuth):
18 | """Convert a "horizontal" coordinate given in altitude and azimuth to the
19 | corresponding 3D cartesian location."""
20 | theta = math.pi / 2 - math.radians(altitude)
21 | phi = math.radians(-azimuth)
22 | x = math.sin(phi) * math.sin(-theta)
23 | y = math.sin(theta) * math.cos(phi)
24 | z = math.cos(theta)
25 | return x, y, z
26 |
27 | def scale_vector(vector, scale):
28 | """Scale a 3D vector's components by scale."""
29 | return vector[0] * scale, vector[1] * scale, vector[2] * scale
30 |
--------------------------------------------------------------------------------
/movie/daemon/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2015 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | ENV DEBIAN_FRONTEND noninteractive
19 | ENV APT_LISTCHANGES_FRONTEND none
20 | ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1
21 |
22 | COPY conf/requirements.txt /tmp/requirements-eclipse2017.txt
23 | RUN apt-get install -y --no-install-recommends ffmpeg unzip python-tk python-mpltoolkits.basemap && \
24 | pip install -r /tmp/requirements-eclipse2017.txt && \
25 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
26 |
27 | ADD application.tar /app
28 |
29 | WORKDIR /app
30 | USER www-data
31 |
32 | CMD ["python", "main.py"]
33 |
--------------------------------------------------------------------------------
/scripts/_unittest:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 |
18 | #set -e
19 |
20 | if [ "$APP" != "" ]; then
21 | echo "NO TESTS RUN"
22 | exit 0
23 | fi
24 |
25 | # Common tests
26 | COMMON_PASS=0
27 | if [ "$APP" == "" ]; then
28 | echo; echo "=== Common tests ==="
29 | cd common_tests
30 | ./run_tests
31 | COMMON_PASS=$?
32 | cd ..
33 | fi
34 |
35 |
36 | # Final result
37 | echo
38 | test $COMMON_PASS -eq 0 -a $UPLOAD_DAEMON_PASS -eq 0 -a \
39 | $UPLOAD_SERVER_PASS -eq 0 -a $PROFILE_PASS -eq 0 -a \
40 | $MOVIE_DAEMON_PASS -eq 0
41 | if [ $? == 0 ]; then
42 | echo "ALL TESTS PASSED"
43 | else
44 | echo "SOME TEST(S) FAILED"
45 | fi
46 |
--------------------------------------------------------------------------------
/src/solar_eclipse_analysis/read_image_exif.py:
--------------------------------------------------------------------------------
1 | """Read images"""
2 |
3 | import os
4 | import logging
5 | import argparse
6 | import pickle
7 | from exif import _extract_exif_metadata, _extract_image_metadata
8 | from PIL import Image
9 | from rawkit.raw import Raw
10 | from multiprocessing import Pool
11 | from functools import partial
12 |
13 | IMGDIR=os.getenv("IMAGE_DIR")
14 |
15 |
16 | def get_arguments():
17 | parser = argparse.ArgumentParser(description='Read images.')
18 | parser.add_argument('--input', type=str, default="extracted_metadata.pkl")
19 | parser.add_argument('--files', type=str)
20 | return parser.parse_args()
21 |
22 | def process_image(d filename):
23 | img = Image.open(filename)
24 | format_ = img.format
25 | width = img.width
26 | height = img.height
27 | return filename, (format_, width, height)
28 |
29 | def main():
30 | args = get_arguments()
31 | r = pickle.load(open(args.input))
32 | for key in r:
33 | s = r[key]
34 | if s.has_key('width') and s.has_key('height'):
35 | width, height = s['width'], s['height']
36 | else:
37 | width, height = None
38 | process_image(r, os.path.join(IMGDIR, key))
39 | if __name__ == '__main__':
40 | main()
41 |
--------------------------------------------------------------------------------
/static-nginx/templates/pod.yaml.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | apiVersion: v1
17 | kind: Pod
18 | metadata:
19 | name: static-nginx
20 | labels:
21 | app: static-nginx
22 | spec:
23 | containers:
24 | - name: static-nginx
25 | image: {{GCR_PREFIX}}/static-nginx
26 | ports:
27 | - containerPort: 80
28 | livenessProbe:
29 | httpGet:
30 | path: /static/css/main.css
31 | port: 80
32 | resources:
33 | limits:
34 | cpu: 500m
35 | memory: 1000M
36 | requests:
37 | cpu: 500m
38 | memory: 1000M
39 |
--------------------------------------------------------------------------------
/admin/app/tests/flask/run_flask_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # If installation fails then we do not want to run tests
18 | set -e
19 |
20 |
21 | # eclipse2017/admin/app/app
22 | APP_PATH=$(dirname $(dirname $PWD))
23 |
24 | # eclipse2017/admin/
25 | ADMIN_PATH=$(dirname $APP_PATH)
26 |
27 | # eclipse2017/
28 | PRJ_PATH=$(dirname $ADMIN_PATH)
29 | BUILD_DIR=$PRJ_PATH/build
30 |
31 | # common_tests/
32 | COMMON_TEST_PATH=$PRJ_PATH/common_tests
33 |
34 | # admin/tests/flask/lib
35 | ADMIN_LIB_PATH=$PWD/lib
36 | # common_tests/lib
37 | COMMON_LIB_PATH=$COMMON_TEST_PATH/lib
38 |
39 | export PYTHONPATH=/app:/app/admin/app
40 | python -m unittest discover . "*_test.py"
41 |
--------------------------------------------------------------------------------
/common/service_account.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | import os
17 |
18 | from google.oauth2 import service_account
19 |
20 | import constants
21 | from eclipse2017_exceptions import CouldNotObtainCredentialsError
22 |
23 | def get_credentials(scopes=''):
24 | """
25 | Returns credentials object for eclipse service account or None.
26 | """
27 | try:
28 | credentials = service_account.Credentials.from_service_account_file(
29 | constants.SERVICE_ACCOUNT_PATH)
30 | credentials = credentials.with_scopes(scopes)
31 | except (IOError, ValueError, KeyError) as e:
32 | raise CouldNotObtainCredentialsError(e.message)
33 | return credentials
34 |
--------------------------------------------------------------------------------
/static-nginx/app/static/src/behaviors/eclipse-debug-logger.html:
--------------------------------------------------------------------------------
1 |
17 |
43 |
--------------------------------------------------------------------------------
/movie/templates/deployment.yaml.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | apiVersion: v1
17 | kind: ReplicationController
18 | metadata:
19 | name: movie
20 | spec:
21 | selector:
22 | app: movie
23 | template:
24 | metadata:
25 | labels:
26 | app: movie
27 | spec:
28 | containers:
29 | - name: movie-daemon
30 | image: {{GCR_PREFIX}}/movie-daemon
31 | resources:
32 | limits:
33 | cpu: 1000m
34 | memory: 2000M
35 | requests:
36 | cpu: 1000m
37 | memory: 2000M
38 |
--------------------------------------------------------------------------------
/profile/app/tests/flask/run_flask_tests:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Copyright 2016 Google Inc.
4 | #
5 | # Licensed under the Apache License, Version 2.0 (the "License");
6 | # you may not use this file except in compliance with the License.
7 | # You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 |
17 | # If installation fails then we do not want to run tests
18 | set -e
19 |
20 |
21 | # eclipse2017/profile/app/app
22 | APP_PATH=$(dirname $(dirname $PWD))
23 |
24 | # eclipse2017/profile/
25 | PROFILE_PATH=$(dirname $APP_PATH)
26 |
27 | # eclipse2017/
28 | PRJ_PATH=$(dirname $PROFILE_PATH)
29 | BUILD_DIR=$PRJ_PATH/build
30 |
31 | # common_tests/
32 | COMMON_TEST_PATH=$PRJ_PATH/common_tests
33 |
34 | # profile/tests/flask/lib
35 | PROFILE_LIB_PATH=$PWD/lib
36 | # common_tests/lib
37 | COMMON_LIB_PATH=$COMMON_TEST_PATH/lib
38 |
39 | export PYTHONPATH=/app:/app/profile/app
40 | python -m unittest discover . "*_test.py"
41 |
--------------------------------------------------------------------------------
/upload/system_tests/app/main.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | import logging
17 | import time
18 |
19 | from common import constants
20 |
21 | from tests.upload_server_stress_test import UploadServerStressTest
22 |
23 |
24 | logging.basicConfig(level=logging.INFO, format=constants.LOG_FMT_M_THREADED)
25 |
26 | TESTS = (
27 | (UploadServerStressTest, [], {'logger': logging}),
28 | )
29 |
30 |
31 | def main():
32 |
33 | for test_cls, args, kwargs in TESTS:
34 |
35 | test = test_cls(*args, **kwargs)
36 | res = test.run_when_ready()
37 |
38 | # Loop forever. Otherwise kubernetes will restart the container
39 | while True: time.sleep(1000)
40 |
41 |
42 | if __name__ == '__main__':
43 | main()
44 |
--------------------------------------------------------------------------------
/base-container/Dockerfile:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM ubuntu:16.04
17 |
18 | ENV APT_LISTCHANGES_FRONTEND none
19 | ENV DEBIAN_FRONTEND noninteractive
20 |
21 | #RUN sed -i -e 's/archive.ubuntu.com/mirror.symnds.com/g' /etc/apt/sources.list && \
22 | COPY requirements.txt /tmp/requirements.txt
23 |
24 | RUN sed -i -e 's/archive.ubuntu.com/mirrors.kernel.org/g' /etc/apt/sources.list && \
25 | apt-get update -y && \
26 | apt-get upgrade -y && \
27 | apt-get install -y --no-install-recommends apt-utils curl iputils-ping telnet netcat-traditional python-setuptools python-pip libraw-dev && \
28 | pip install --upgrade pip && \
29 | pip install -r /tmp/requirements.txt && \
30 | apt-get clean && rm -rf /tmp/* /var/tmp/*
31 |
--------------------------------------------------------------------------------
/image-processor/templates/deployment.yaml.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | apiVersion: v1
17 | kind: ReplicationController
18 | metadata:
19 | name: image-processor
20 | spec:
21 | selector:
22 | app: image-processor
23 | template:
24 | metadata:
25 | labels:
26 | app: image-processor
27 | spec:
28 | containers:
29 | - name: image-processor-daemon
30 | image: {{GCR_PREFIX}}/image-processor-daemon
31 | resources:
32 | limits:
33 | cpu: 1000m
34 | memory: 2000M
35 | requests:
36 | cpu: 1000m
37 | memory: 2000M
38 |
--------------------------------------------------------------------------------
/static-nginx/app/static/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | https://eclipsemega.movie/
7 | 2017-01-01
8 | daily
9 | 1.0
10 |
11 |
12 | https://eclipsemega.movie/about
13 | 2017-01-01
14 | daily
15 | 1.0
16 |
17 |
18 | https://eclipsemega.movie/megamovie
19 | 2017-01-01
20 | daily
21 | 1.0
22 |
23 |
24 | https://eclipsemega.movie/safety
25 | 2017-01-01
26 | daily
27 | 1.0
28 |
29 |
30 | https://eclipsemega.movie/resources
31 | 2017-01-01
32 | daily
33 | 1.0
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/solar_eclipse_renderer/render_constants.py:
--------------------------------------------------------------------------------
1 | # Copyright 2017 Google Inc.
2 | #
3 | # Licensed under the Apache License, Version 2.0 (the "License");
4 | # you may not use this file except in compliance with the License.
5 | # You may obtain a copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS,
11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | # See the License for the specific language governing permissions and
13 | # limitations under the License.
14 |
15 | import math
16 |
17 | SUN_RADIUS = 695.700 * 1.e6
18 | # MOON_RADIUS = 1.737 * 1.e6
19 | # Note: artificially lowered to make in-umbra areas appear "total"
20 | MOON_RADIUS = 1.7 * 1.e6
21 | EARTH_MOON_DISTANCE = 355.567238 * 1.e6
22 | SUN_EARTH_DISTANCE = 152.060 * 1e9
23 |
24 | SEGMENTS = 100
25 | RING_COUNT = 100
26 |
27 | colors = (255, 0, 0), (0, 255, 0), (0, 0, 255)
28 |
29 | RES_X = 1920
30 | RES_Y = 1080
31 |
32 | NORTHERN_MIN = math.radians(45)
33 | NORTHERN_MAX = math.radians(135)
34 | SOUTHERN_MIN = math.radians(225)
35 | SOUTHERN_MAX = math.radians(315)
36 | WESTERN_MIN = math.radians(-45)
37 | WESTERN_MAX = math.radians(45)
38 | EASTERN_MIN = math.radians(180-45)
39 | EASTERN_MAX = math.radians(180+45)
40 |
--------------------------------------------------------------------------------
/scripts/print_photos.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """Print list of photos (debug tool)."""
17 |
18 | import argparse
19 | from google.cloud import datastore
20 | import common.service_account as sa
21 |
22 | DEFAULT_PROJECT = 'eclipse-2017-test-147301'
23 |
24 | def get_arguments():
25 | parser = argparse.ArgumentParser(description='Print list of photos.')
26 | parser.add_argument('--project_id', type=str, default=DEFAULT_PROJECT)
27 | return parser.parse_args()
28 |
29 | def main():
30 | args = get_arguments()
31 |
32 | client = datastore.Client(project=args.project_id)
33 |
34 | query = client.query(kind="Photo")
35 | entities = query.fetch()
36 | for entity in entities:
37 | print "Photo id (hashed):", entity
38 |
39 | if __name__ == '__main__':
40 | main()
41 |
--------------------------------------------------------------------------------
/scripts/print_processed_photos.py:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2017 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """Print list of photos (debug tool)."""
17 |
18 | import argparse
19 | from google.cloud import datastore
20 | import common.service_account as sa
21 |
22 | DEFAULT_PROJECT = 'eclipse-2017-test-147301'
23 |
24 | def get_arguments():
25 | parser = argparse.ArgumentParser(description='Print list of photos.')
26 | parser.add_argument('--project_id', type=str, default=DEFAULT_PROJECT)
27 | return parser.parse_args()
28 |
29 | def main():
30 | args = get_arguments()
31 |
32 | client = datastore.Client(project=args.project_id)
33 |
34 | query = client.query(kind="ProcessedImage")
35 | entities = query.fetch()
36 | for entity in entities:
37 | print "ProcessedImage:", entity
38 |
39 | if __name__ == '__main__':
40 | main()
41 |
--------------------------------------------------------------------------------
/datastore-emulator/templates/Dockerfile.tmpl:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 Google Inc.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | FROM {{GCR_PREFIX_WITH_SLASH}}base-container:latest
17 |
18 | USER root
19 |
20 | ENV CLOUDSDK_CORE_DISABLE_PROMPTS 1
21 | ENV DATA_DIR "/data"
22 |
23 | RUN apt-get install -yqq python openjdk-8-jre && \
24 | curl https://sdk.cloud.google.com | bash && \
25 | /root/google-cloud-sdk/bin/gcloud config set project {{PROJECT_ID}} && \
26 | /root/google-cloud-sdk/bin/gcloud components install beta && \
27 | /root/google-cloud-sdk/bin/gcloud components install cloud-datastore-emulator && \
28 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
29 |
30 | EXPOSE {{HOST_PORT}}
31 |
32 | CMD /root/google-cloud-sdk/bin/gcloud beta emulators datastore start --no-legacy --host-port=0.0.0.0:{{HOST_PORT}} --consistency="1.0" --data-dir=$DATA_DIR
33 |
--------------------------------------------------------------------------------
/static-nginx/app/static/src/eclipse-view404.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
39 |