Skip to content

Commit

Permalink
Add server
Browse files Browse the repository at this point in the history
  • Loading branch information
DouweM committed Aug 13, 2023
1 parent 889b39a commit 3d2f28b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# This is used by many apps that show the (relative) date and time.
TZ="America/Mexico_City"

## TODO: pixbyt-server
SERVER_PORT="1234"
# SERVER_USERNAME="<username>"
# SERVER_PASSWORD="<password>"
# SERVER_RUN_SCHEDULER="false"

## target-tidbyt
# Find your Device ID and API Token in the Tidbyt mobile app under Settings > General > Get API Key.
TIDBYT_DEVICE_ID="<device ID>"
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update
RUN apt-get install -y curl
# TODO: Make this work
# RUN export PIXLET_VERSION=$(curl https://raw.githubusercontent.com/tidbyt/community/main/PIXLET_VERSION | sed 's/v//')
ARG PIXLET_VERSION=0.27.2
ARG PIXLET_VERSION=0.28.0
RUN echo $PIXLET_VERSION
RUN curl -L -o pixlet.tar.gz https://github.com/tidbyt/pixlet/releases/download/v${PIXLET_VERSION}/pixlet_${PIXLET_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz
RUN tar -xvf pixlet.tar.gz
Expand All @@ -26,11 +26,11 @@ COPY ./meltano.yml .
COPY ./plugins/utilities/ ./plugins/utilities/
COPY ./plugins/plugins.meltano.yml ./plugins/plugins.meltano.yml

# Prod: Install loaders and Airflow
# Prod: Install loaders, server, and Airflow
FROM base as prod-preinstall
RUN meltano --log-level=debug install

# Dev: Only install loaders, not Airflow
# Dev: Only install loaders, not server and Airflow
FROM base as dev-preinstall
RUN meltano --log-level=debug install loaders

Expand All @@ -53,4 +53,4 @@ COPY . .
ENV MELTANO_PROJECT_READONLY 1

ENTRYPOINT ["meltano"]
CMD ["invoke", "airflow", "scheduler"]
CMD ["invoke", "server"]
3 changes: 2 additions & 1 deletion apps/hello-world/hello-world.star
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
load("render.star", "render")
load("pixlib/const.star", "const")
load("pixlib/input.star", "input")
load("./client.star", "client")

def main(config):
NAME = config.get("name") or "world"
NAME = input.json().get("name") orconfig.get("name") or "world"

image = client.get_image()
text = client.get_response(NAME)
Expand Down
2 changes: 1 addition & 1 deletion apps/hello-world/pixbyt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins:
extractors:
- name: tap-pixlet--hello-world
inherit_from: tap-pixlet
pip_url: git+https://github.com/DouweM/tap-pixlet.git -r apps/hello-world/requirements.txt
pip_url: git+https://github.com/DouweM/tap-pixlet.git@input -r apps/hello-world/requirements.txt # TODO: Drop @input
config:
path: apps/hello-world
app_config:
Expand Down
24 changes: 23 additions & 1 deletion plugins/plugins.meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
extractors:
- name: tap-pixlet
namespace: tap_pixlet
pip_url: git+https://github.com/DouweM/tap-pixlet.git
pip_url: git+https://github.com/DouweM/tap-pixlet.git@input # TODO: Drop @input
settings:
- name: path
- name: installation_id
Expand Down Expand Up @@ -30,6 +30,28 @@ plugins:
pip_url: git+https://github.com/DouweM/target-webp.git

utilities:
- name: server
namespace: pixbyt_server
pip_url: git+https://github.com/DouweM/pixbyt-server.git
executable: pixbyt-server
settings:
- name: port
kind: integer
value: 1234
env: SERVER_PORT
- name: auth
kind: object
- name: auth.username
kind: string
env: SERVER_USERNAME
- name: auth.password
kind: password
env: SERVER_PASSWORD
- name: run_scheduler
kind: boolean
value: true
env: SERVER_RUN_SCHEDULER

- name: airflow
variant: apache
pip_url: git+https://github.com/meltano/airflow-ext.git@main apache-airflow==2.3.4 psycopg2-binary
Expand Down

0 comments on commit 3d2f28b

Please sign in to comment.