-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: across the board tidy up (#102)
- Loading branch information
Showing
30 changed files
with
168 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
provider: nitric/aws@1.0.2 | ||
provider: nitric/aws@1.16.7 | ||
region: us-east-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
provider: nitric/gcp@1.0.2 | ||
provider: nitric/gcp@1.16.7 | ||
gcp-project-id: | ||
region: us-west2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
name: cloudflare-lb | ||
services: | ||
- match: services/*.ts | ||
- basedir: "" | ||
match: services/*.ts | ||
runtime: node | ||
start: npm run dev:services $SERVICE_PATH | ||
batch-services: [] | ||
runtimes: | ||
node: | ||
dockerfile: ./node.dockerfile | ||
context: "" | ||
args: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM node:22.4.1-alpine as build | ||
|
||
ARG HANDLER | ||
|
||
# Python and make are required by certain native package build processes in NPM packages. | ||
RUN --mount=type=cache,sharing=locked,target=/etc/apk/cache \ | ||
apk --update-cache add git g++ make py3-pip | ||
|
||
RUN yarn global add typescript @vercel/ncc | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY package.json *.lock *-lock.json ./ | ||
|
||
RUN yarn import || echo "" | ||
|
||
RUN --mount=type=cache,sharing=locked,target=/tmp/.yarn_cache \ | ||
set -ex && \ | ||
yarn install --production --prefer-offline --frozen-lockfile --cache-folder /tmp/.yarn_cache | ||
|
||
RUN test -f tsconfig.json || echo "{\"compilerOptions\":{\"esModuleInterop\":true,\"target\":\"es2015\",\"moduleResolution\":\"node\"}}" > tsconfig.json | ||
|
||
COPY . . | ||
|
||
RUN --mount=type=cache,target=/tmp/ncc-cache \ | ||
ncc build ${HANDLER} -o lib/ -t | ||
|
||
FROM node:22.4.1-alpine as final | ||
|
||
RUN apk update && \ | ||
apk add --no-cache ca-certificates && \ | ||
update-ca-certificates | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY . . | ||
|
||
COPY --from=build /usr/app/node_modules/ ./node_modules/ | ||
|
||
COPY --from=build /usr/app/lib/ ./lib/ | ||
|
||
ENTRYPOINT ["node", "lib/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.nitric/ | ||
.git/ | ||
.idea/ | ||
.vscode/ | ||
.github/ | ||
*.dockerfile | ||
*.dockerignore | ||
node_modules/ | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,8 @@ | |
"workspaces": [ | ||
"apps/*", | ||
"packages/*" | ||
] | ||
], | ||
"devDependencies": { | ||
"ts-node": "^10.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
name: python-prediction | ||
services: | ||
- match: services/*.py | ||
- basedir: "" | ||
match: services/*.py | ||
runtime: python | ||
start: pipenv run dev $SERVICE_PATH | ||
batch-services: [] | ||
runtimes: | ||
python: | ||
dockerfile: ./python.dockerfile | ||
context: "" | ||
args: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM python:3.11-slim | ||
|
||
# Setup the var pointing to the current nitric service being built | ||
ARG HANDLER | ||
ENV HANDLER=${HANDLER} | ||
|
||
ENV PYTHONUNBUFFERED=TRUE | ||
ENV PYTHONPATH="." | ||
|
||
RUN apt-get update -y && \ | ||
apt-get install -y ca-certificates git && \ | ||
update-ca-certificates | ||
|
||
RUN pip install --no-cache-dir --upgrade pip pipenv | ||
|
||
COPY . . | ||
|
||
# Guarantee lock file if we have a Pipfile and no Pipfile.lock | ||
RUN (stat Pipfile && pipenv lock) || echo "No Pipfile found" | ||
|
||
# Output a requirements.txt file for final module install if there is a Pipfile.lock found | ||
RUN (stat Pipfile.lock && pipenv requirements > requirements.txt) || echo "No Pipfile.lock found" | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
ENTRYPOINT python -u $HANDLER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.mypy_cache/ | ||
.nitric/ | ||
.venv/ | ||
nitric-spec.json | ||
nitric.yaml | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "python starter" | ||
|
||
[requires] | ||
python_version = "3.12" | ||
|
||
[packages] | ||
nitric = "==1.2.3" | ||
"google.auth" = "*" | ||
google-api-python-client = "*" | ||
|
||
[scripts] | ||
dev = "watchmedo auto-restart -p '*.py' -R python -- -u" | ||
|
||
[dev-packages] | ||
watchdog = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: python-starter | ||
services: | ||
- match: services/*.py | ||
start: pipenv run dev $SERVICE_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { api, kv, topic } from "@nitric/sdk"; | ||
|
||
// Stores | ||
export const custStore = kv("customers").for("writing"); | ||
export const custStore = kv("customers").allow("set"); | ||
// API | ||
export const custApi = api("public"); | ||
// Topics | ||
export const custCreatePub = topic("created").for("publishing"); | ||
export const custCreatePub = topic("created").allow("publish"); | ||
export const custCreateSub = topic("created"); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters