-
Notifications
You must be signed in to change notification settings - Fork 13
Update FirehoseJob.py #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e79ba8e
938aafc
25c1419
79c67c7
31e043c
3ef9408
eda4748
09516d9
d53c0a2
3a4d796
4991940
c50b32e
d5da7cc
4ae4159
9a4b167
ca76ad8
0b6f89c
df9cdcb
dbb2453
787ee84
b889a27
c122341
a2d4295
d17cb6f
9e9792a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,4 +164,6 @@ lib | |
| lib64 | ||
| __pycache__ | ||
|
|
||
| neo4jcreds.json | ||
| .idea | ||
|
|
||
| neo4jcreds.json | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM python:3.7 | ||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends supervisor \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY . . | ||
| RUN pip install prefect==0.10.1 simplejson twarc neo4j boto3==1.12.39 \ | ||
| pandas twint \ | ||
| && ( prefect agent install local > supervisord.conf ) | ||
| RUN prefect backend server | ||
| RUN ["chmod","+x","./infra/pipelines/docker/nonrapids-entrypoint.sh"] | ||
| CMD ["./infra/pipelines/docker/nonrapids-entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ######## | ||
| # | ||
| # Run from git root's parent: with .env in local folder and ProjectDomino/ inside | ||
| # | ||
| # $ touch .env | ||
| # $ sudo docker-compose -f ./ProjectDomino/infra/pipelines/docker/docker-compose.yml up -d prefect-agent | ||
| # | ||
| ######## | ||
|
|
||
| version: '3.4' | ||
|
|
||
| services: | ||
| ############################################################################## | ||
| tor: | ||
| build: ./tor | ||
| network_mode: 'bridge' | ||
| restart: always | ||
| ports: | ||
| - 127.0.0.1:9050:9050 | ||
| ############################################################################## | ||
| prefect-agent: | ||
| image: prefect-agent:0.0.5 | ||
| build: | ||
| context: ../../../ | ||
| dockerfile: ./infra/pipelines/docker/nonrapids-Dockerfile | ||
| container_name: prefect-agent | ||
| network_mode: 'bridge' | ||
| restart: unless-stopped | ||
| environment: | ||
| PREFECT__SERVER__HOST: ${PREFECT__SERVER__HOST:-http://host.docker.internal} | ||
| PREFECT__SERVER__PORT: ${PREFECT__SERVER__PORT:-4200} | ||
| PREFECT__SERVER__UI__HOST: ${PREFECT__SERVER__UI__HOST:-http://host.docker.internal} | ||
| PREFECT__SERVER__UI__PORT: ${PREFECT__SERVER__UI__PORT:-8080} | ||
| AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-} | ||
| AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-} | ||
| logging: | ||
| options: | ||
| tag: 'ImageName:{{.ImageName}}/Name:{{.Name}}/ID:{{.ID}}/ImageFullID:{{.ImageFullID}}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/bash | ||
|
|
||
| echo "Starting prefect executor daemon in foreground" | ||
| supervisord --nodaemon |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| FROM alpine | ||
|
|
||
| ARG TARGETPLATFORM | ||
| ARG BUILDPLATFORM | ||
| ARG BUILD_DATE | ||
| ARG VCS_REF | ||
| ARG VERSION | ||
|
|
||
|
|
||
|
|
||
| RUN apk add --no-cache curl tor && \ | ||
| sed "1s/^/SocksPort 0.0.0.0:9050\n/" /etc/tor/torrc.sample > /etc/tor/torrc | ||
|
|
||
| EXPOSE 9050 | ||
|
|
||
| HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ | ||
| CMD curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations | ||
|
|
||
| VOLUME ["/var/lib/tor"] | ||
|
|
||
| USER tor | ||
|
|
||
| CMD ["tor"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import pyarrow as pa | ||
|
|
||
| ### When dtype -> arrow ambiguious, override | ||
| KNOWN_FIELDS = [ | ||
| [0, 'contributors', pa.string()], | ||
| [1, 'coordinates', pa.string()], | ||
| [2, 'created_at', pa.string()], | ||
|
|
||
| #[3, 'display_text_range', pa.list_(pa.int64())], | ||
| [3, 'display_text_range', pa.string()], | ||
|
|
||
| [4, 'entities', pa.string()], | ||
| [5, 'extended_entities', pa.string()], #extended_entities_t ], | ||
| [7, 'favorited', pa.bool_()], | ||
| [8, 'favorite_count', pa.int64()], | ||
| [9, 'full_text', pa.string()], | ||
| [10, 'geo', pa.string()], | ||
| [11, 'id', pa.int64() ], | ||
| [12, 'id_str', pa.string() ], | ||
| [13, 'in_reply_to_screen_name', pa.string() ], | ||
| [14, 'in_reply_to_status_id', pa.int64() ], | ||
| [15, 'in_reply_to_status_id_str', pa.string() ], | ||
| [16, 'in_reply_to_user_id', pa.int64() ], | ||
| [17, 'in_reply_to_user_id_str', pa.string() ], | ||
| [18, 'is_quote_status', pa.bool_() ], | ||
| [19, 'lang', pa.string() ], | ||
| [20, 'place', pa.string()], | ||
| [21, 'possibly_sensitive', pa.bool_()], | ||
| [22, 'quoted_status', pa.string()], | ||
| [23, 'quoted_status_id', pa.int64()], | ||
| [24, 'quoted_status_id_str', pa.string()], | ||
| [25, 'quoted_status_permalink', pa.string()], | ||
| [26, 'retweet_count', pa.int64()], | ||
| [27, 'retweeted', pa.bool_()], | ||
| [28, 'retweeted_status', pa.string()], | ||
| [29, 'scopes', pa.string()], | ||
| [30, 'source', pa.string()], | ||
| [31, 'truncated', pa.bool_()], | ||
| [32, 'user', pa.string()], | ||
|
|
||
| #[33, 'withheld_in_countries', pa.list_(pa.string())], | ||
| [33, 'withheld_in_countries', pa.string()], | ||
|
|
||
| #[34, 'followers', pa.struct({'followers': pa.bool_()})] | ||
| [34, 'followers', pa.string()] | ||
| ] | ||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guessing we'll also need pandas/twint/bs4