Try to get deploy working with pulsar 1.7.0

This commit is contained in:
Eric Allam
2023-01-11 20:17:01 +00:00
parent ae43a5c391
commit 38e20b9340
5 changed files with 50 additions and 73 deletions
+12 -2
View File
@@ -8,7 +8,11 @@ RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
# Base strategy to have layer caching
FROM sitespeedio/node:ubuntu-22.04-nodejs-18.12.1 AS base
RUN apt-get update && apt-get install -y openssl
RUN apt-get update && apt-get install openssl g++ make wget python3 -y
ENV PULSAR_CPP_CLIENT_VERSION=2.10.3
RUN wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb -q
RUN wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb -q
RUN dpkg -i ./apache-pulsar-client*.deb
WORKDIR /app
COPY .gitignore .gitignore
COPY --from=pruner /app/out/json/ .
@@ -20,12 +24,14 @@ FROM base AS dev-deps
WORKDIR /app
RUN corepack enable
ENV NODE_ENV development
RUN npm config set python /usr/bin/python3
RUN pnpm install --ignore-scripts --frozen-lockfile
FROM base AS production-deps
WORKDIR /app
RUN corepack enable
ENV NODE_ENV production
RUN npm config set python /usr/bin/python3
RUN pnpm install --prod --frozen-lockfile
COPY --from=pruner /app/out/full/apps/webapp/prisma/schema.prisma /app/apps/webapp/prisma/schema.prisma
RUN pnpx prisma generate --schema /app/apps/webapp/prisma/schema.prisma
@@ -43,7 +49,11 @@ RUN pnpm run build --filter=webapp...
# Runner
FROM sitespeedio/node:ubuntu-22.04-nodejs-18.12.1 AS runner
RUN apt-get update && apt-get install -y openssl ca-certificates
RUN apt-get update && apt-get install openssl g++ make wget python3 ca-certificates -y
ENV PULSAR_CPP_CLIENT_VERSION=2.10.3
RUN wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client.deb -q
RUN wget https://archive.apache.org/dist/pulsar/pulsar-${PULSAR_CPP_CLIENT_VERSION}/DEB/apache-pulsar-client-dev.deb -q
RUN dpkg -i ./apache-pulsar-client*.deb
WORKDIR /app
RUN corepack enable
ENV NODE_ENV production
+2 -1
View File
@@ -88,7 +88,8 @@
},
"PIZZLY_HOST": "https://auth.trigger.dev",
"TRIGGER_LOG_LEVEL": "debug",
"PULSAR_DEBUG": true
"PULSAR_DEBUG": true,
"PULSAR_ENABLED": "1"
}
},
{
+2 -1
View File
@@ -18,7 +18,8 @@
"test": "jest"
},
"dependencies": {
"pulsar-client": "1.8.0",
"pulsar-client": "1.7.0",
"segfault-handler": "^1.3.0",
"ulid": "^2.3.0",
"zod": "^3.20.2"
}
+9 -3
View File
@@ -3,6 +3,8 @@ import Pulsar, {
AuthenticationToken,
} from "pulsar-client";
import SegfaultHandler from "segfault-handler";
export type ClientOptions = {
serviceUrl?: string;
token?: string;
@@ -38,9 +40,13 @@ export function createPulsarClient(options?: ClientOptions): PulsarClient {
? new AuthenticationToken({ token: opts.token })
: oauth2AuthenticationFromEnv();
Pulsar.Client.setLogHandler((level, file, line, message) => {
console.log("[%s][%s:%d] %s", level, file, line, message);
});
if (process.env.PULSAR_DEBUG) {
SegfaultHandler.registerHandler("crash.log");
Pulsar.Client.setLogHandler((level, file, line, message) => {
console.log("[%s][%s:%d] %s", level, file, line, message);
});
}
console.log(`Connecting to pulsar instance at ${serviceUrl}...`);
+25 -66
View File
@@ -668,13 +668,15 @@ importers:
'@types/node': ^18.11.9
dotenv: ^16.0.3
jest: ^29.3.1
pulsar-client: 1.8.0
pulsar-client: 1.7.0
segfault-handler: ^1.3.0
ts-jest: ^29.0.3
typescript: ^4.9.4
ulid: ^2.3.0
zod: ^3.20.2
dependencies:
pulsar-client: 1.8.0
pulsar-client: 1.7.0
segfault-handler: 1.3.0
ulid: 2.3.0
zod: 3.20.2
devDependencies:
@@ -4328,24 +4330,6 @@ packages:
read-yaml-file: 1.1.0
dev: true
/@mapbox/node-pre-gyp/1.0.10:
resolution: {integrity: sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==}
hasBin: true
dependencies:
detect-libc: 2.0.1
https-proxy-agent: 5.0.1
make-dir: 3.1.0
node-fetch: 2.6.7
nopt: 5.0.0
npmlog: 5.0.1
rimraf: 3.0.2
semver: 7.3.8
tar: 6.1.12
transitivePeerDependencies:
- encoding
- supports-color
dev: false
/@mrmlnc/readdir-enhanced/2.2.1:
resolution: {integrity: sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==}
engines: {node: '>=4'}
@@ -6235,14 +6219,6 @@ packages:
readable-stream: 2.3.7
dev: false
/are-we-there-yet/2.0.0:
resolution: {integrity: sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==}
engines: {node: '>=10'}
dependencies:
delegates: 1.0.0
readable-stream: 3.6.0
dev: false
/are-we-there-yet/3.0.1:
resolution: {integrity: sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -7203,6 +7179,7 @@ packages:
/chownr/2.0.0:
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
engines: {node: '>=10'}
dev: true
/ci-info/3.7.0:
resolution: {integrity: sha512-2CpRNYmImPx+RXKLq6jko/L07phmS9I02TyqkcNU20GCF/GgaWvc58hPtjxDX8lPpkdwc9sNh72V9k00S7ezog==}
@@ -8059,6 +8036,7 @@ packages:
/detect-libc/2.0.1:
resolution: {integrity: sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==}
engines: {node: '>=8'}
dev: true
/detect-newline/3.1.0:
resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==}
@@ -10007,6 +9985,7 @@ packages:
engines: {node: '>= 8'}
dependencies:
minipass: 3.3.6
dev: true
/fs.realpath/1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@@ -10066,21 +10045,6 @@ packages:
wide-align: 1.1.5
dev: false
/gauge/3.0.2:
resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==}
engines: {node: '>=10'}
dependencies:
aproba: 2.0.0
color-support: 1.1.3
console-control-strings: 1.1.0
has-unicode: 2.0.1
object-assign: 4.1.1
signal-exit: 3.0.7
string-width: 4.2.3
strip-ansi: 6.0.1
wide-align: 1.1.5
dev: false
/gauge/4.0.4:
resolution: {integrity: sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -12892,6 +12856,7 @@ packages:
engines: {node: '>=8'}
dependencies:
yallist: 4.0.0
dev: true
/minizlib/2.1.2:
resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
@@ -12899,6 +12864,7 @@ packages:
dependencies:
minipass: 3.3.6
yallist: 4.0.0
dev: true
/mintlify/1.3.0:
resolution: {integrity: sha512-5QBb07c5G2nm2ASVqcqaVZFRPq0zuly7v7H2BqwM6bsIR/6nAiyCBUWEmVbKDxjszNBcHGvaC5NV0w6y/MEwkg==}
@@ -12953,6 +12919,7 @@ packages:
resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
engines: {node: '>=10'}
hasBin: true
dev: true
/morgan/1.10.0:
resolution: {integrity: sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==}
@@ -13035,6 +13002,10 @@ packages:
thenify-all: 1.6.0
dev: true
/nan/2.17.0:
resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==}
dev: false
/nano-time/1.0.0:
resolution: {integrity: sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA==}
dependencies:
@@ -13185,14 +13156,6 @@ packages:
abbrev: 1.1.1
dev: true
/nopt/5.0.0:
resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==}
engines: {node: '>=6'}
hasBin: true
dependencies:
abbrev: 1.1.1
dev: false
/nopt/6.0.0:
resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -13259,15 +13222,6 @@ packages:
set-blocking: 2.0.0
dev: false
/npmlog/5.0.1:
resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==}
dependencies:
are-we-there-yet: 2.0.0
console-control-strings: 1.1.0
gauge: 3.0.2
set-blocking: 2.0.0
dev: false
/npmlog/6.0.2:
resolution: {integrity: sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==}
engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
@@ -14196,17 +14150,13 @@ packages:
resolution: {integrity: sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==}
dev: true
/pulsar-client/1.8.0:
resolution: {integrity: sha512-DPyZ5qee1mrfdBKlj1Hm2E7pMXWB8tkr0HqXDQPK8cd/mU0zHEJ6l4CJ6+NxBfqxhi52QynKCY78XJ1hEpb0cg==}
/pulsar-client/1.7.0:
resolution: {integrity: sha512-Ips8j9S13Zx6zwHsaa+Eg4ASTXv5aM4CtE55Bw0uOuKr2mBH4bmp9eizIIkhBRHoo5zcsCuKdnwLUAG6G5FRew==}
engines: {node: '>=10.16.0'}
requiresBuild: true
dependencies:
'@mapbox/node-pre-gyp': 1.0.10
bindings: 1.5.0
node-addon-api: 4.3.0
transitivePeerDependencies:
- encoding
- supports-color
dev: false
/pump/2.0.1:
@@ -15065,6 +15015,14 @@ packages:
kind-of: 6.0.3
dev: true
/segfault-handler/1.3.0:
resolution: {integrity: sha512-p7kVHo+4uoYkr0jmIiTBthwV5L2qmWtben/KDunDZ834mbos+tY+iO0//HpAJpOFSQZZ+wxKWuRo4DxV02B7Lg==}
requiresBuild: true
dependencies:
bindings: 1.5.0
nan: 2.17.0
dev: false
/sembear/0.5.2:
resolution: {integrity: sha512-Ij1vCAdFgWABd7zTg50Xw1/p0JgESNxuLlneEAsmBrKishA06ulTTL/SHGmNy2Zud7+rKrHTKNI6moJsn1ppAQ==}
dependencies:
@@ -15882,6 +15840,7 @@ packages:
minizlib: 2.1.2
mkdirp: 1.0.4
yallist: 4.0.0
dev: true
/temp/0.8.4:
resolution: {integrity: sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==}