:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(rust): drop stray cyclotron-node build output (#125113)
Raúl Negrón-Otero0e7cb7413723
diff --git a/.gitignore b/.gitignoreindex 8e05ec670758..58a4ceffa88d 100644--- a/.gitignore+++ b/.gitignore@@ -221,6 +221,12 @@ posthog/hogql/scripts/.local/rust/cohort-store/rust/cohort-stream-processor/cohort-store/+# Build output of Rust node addons. Each addon also ignores its own output.+# This root rule keeps a local leftover ignored after an addon is deleted+# together with its .gitignore, so `git add -A` cannot commit it.+rust/**/*.node+rust/**/dist/+# Local TLS certs (e.g. mkcert) — never commit private keys*.pemdiff --git a/rust/cyclotron-node/dist/helpers.d.ts b/rust/cyclotron-node/dist/helpers.d.tsdeleted file mode 100644index 5bf697c3555d..000000000000--- a/rust/cyclotron-node/dist/helpers.d.ts+++ /dev/null@@ -1,4 +0,0 @@-import { CyclotronInternalPoolConfig, CyclotronPoolConfig } from './types';-export declare function convertToInternalPoolConfig(poolConfig: CyclotronPoolConfig): CyclotronInternalPoolConfig;-export declare function serializeObject(name: string, obj: Record<string, any> | null): string | null;-export declare function deserializeObject(name: string, str: any): Record<string, any> | null;diff --git a/rust/cyclotron-node/dist/helpers.js b/rust/cyclotron-node/dist/helpers.jsdeleted file mode 100644index 0e4ea8f8f379..000000000000--- a/rust/cyclotron-node/dist/helpers.js+++ /dev/null@@ -1,34 +0,0 @@-"use strict";-Object.defineProperty(exports, "__esModule", { value: true });-exports.convertToInternalPoolConfig = convertToInternalPoolConfig;-exports.serializeObject = serializeObject;-exports.deserializeObject = deserializeObject;-function convertToInternalPoolConfig(poolConfig) {- return {- db_url: poolConfig.dbUrl,- max_connections: poolConfig.maxConnections,- min_connections: poolConfig.minConnections,- acquire_timeout_seconds: poolConfig.acquireTimeoutSeconds,- max_lifetime_seconds: poolConfig.maxLifetimeSeconds,- idle_timeout_seconds: poolConfig.idleTimeoutSeconds,- };-}-function serializeObject(name, obj) {- if (obj === null) {- return null;- }- else if (typeof obj === 'object' && obj !== null) {- return JSON.stringify(obj);- }- throw new Error(`${name} must be either an object or null`);-}-function deserializeObject(name, str) {- if (str === null) {- return null;- }- else if (typeof str === 'string') {- return JSON.parse(str);- }- throw new Error(`${name} must be either a string or null`);-}-//# sourceMappingURL=helpers.js.map\ No newline at end of filediff --git a/rust/cyclotron-node/dist/helpers.js.map b/rust/cyclotron-node/dist/helpers.js.mapdeleted file mode 100644index 2edb2335523b..000000000000--- a/rust/cyclotron-node/dist/helpers.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";;AAEA,kEASC;AAED,0CAOC;AAED,8CAOC;AA3BD,SAAgB,2BAA2B,CAAC,UAA+B;IACvE,OAAO;QACH,MAAM,EAAE,UAAU,CAAC,KAAK;QACxB,eAAe,EAAE,UAAU,CAAC,cAAc;QAC1C,eAAe,EAAE,UAAU,CAAC,cAAc;QAC1C,uBAAuB,EAAE,UAAU,CAAC,qBAAqB;QACzD,oBAAoB,EAAE,UAAU,CAAC,kBAAkB;QACnD,oBAAoB,EAAE,UAAU,CAAC,kBAAkB;KACtD,CAAA;AACL,CAAC;AAED,SAAgB,eAAe,CAAC,IAAY,EAAE,GAA+B;IACzE,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,IAAI,CAAA;IACf,CAAC;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,mCAAmC,CAAC,CAAA;AAC/D,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAY,EAAE,GAAQ;IACpD,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACf,OAAO,IAAI,CAAA;IACf,CAAC;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,kCAAkC,CAAC,CAAA;AAC9D,CAAC"}\ No newline at end of filediff --git a/rust/cyclotron-node/dist/index.d.ts b/rust/cyclotron-node/dist/index.d.tsdeleted file mode 100644index 1e45f8a1a493..000000000000--- a/rust/cyclotron-node/dist/index.d.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './manager';-export * from './types';-export * from './worker';diff --git a/rust/cyclotron-node/dist/index.js b/rust/cyclotron-node/dist/index.jsdeleted file mode 100644index 3dd6f0d42581..000000000000--- a/rust/cyclotron-node/dist/index.js+++ /dev/null@@ -1,20 +0,0 @@-"use strict";-var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {- if (k2 === undefined) k2 = k;- var desc = Object.getOwnPropertyDescriptor(m, k);- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {- desc = { enumerable: true, get: function() { return m[k]; } };- }- Object.defineProperty(o, k2, desc);-}) : (function(o, m, k, k2) {- if (k2 === undefined) k2 = k;- o[k2] = m[k];-}));-var __exportStar = (this && this.__exportStar) || function(m, exports) {- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);-};-Object.defineProperty(exports, "__esModule", { value: true });-__exportStar(require("./manager"), exports);-__exportStar(require("./types"), exports);-__exportStar(require("./worker"), exports);-//# sourceMappingURL=index.js.map\ No newline at end of filediff --git a/rust/cyclotron-node/dist/index.js.map b/rust/cyclotron-node/dist/index.js.mapdeleted file mode 100644index 4f97acf25d57..000000000000--- a/rust/cyclotron-node/dist/index.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,2CAAwB"}\ No newline at end of filediff --git a/rust/cyclotron-node/dist/manager.d.ts b/rust/cyclotron-node/dist/manager.d.tsdeleted file mode 100644index 3153a4efbae9..000000000000--- a/rust/cyclotron-node/dist/manager.d.ts+++ /dev/null@@ -1,19 +0,0 @@-import { CyclotronJobInit, CyclotronPoolConfig, CyclotronInternalPoolConfig } from './types';-type CyclotronManagerInternalConfig = {- shards: CyclotronInternalPoolConfig[];- shardDepthLimit?: number;- shardDepthCheckIntervalSeconds?: number;- shouldCompressVmState?: boolean;- shouldUseBulkJobCopy?: boolean;-};-export type CyclotronManagerConfig = Omit<CyclotronManagerInternalConfig, 'shards'> & {- shards: CyclotronPoolConfig[];-};-export declare class CyclotronManager {- private config;- constructor(config: CyclotronManagerConfig);- connect(): Promise<void>;- createJob(job: CyclotronJobInit): Promise<string>;- bulkCreateJobs(jobs: CyclotronJobInit[]): Promise<string[]>;-}-export {};diff --git a/rust/cyclotron-node/dist/manager.js b/rust/cyclotron-node/dist/manager.jsdeleted file mode 100644index aafa08655656..000000000000--- a/rust/cyclotron-node/dist/manager.js+++ /dev/null@@ -1,75 +0,0 @@-"use strict";-Object.defineProperty(exports, "__esModule", { value: true });-exports.CyclotronManager = void 0;-const cyclotron = require('../index.node');-const helpers_1 = require("./helpers");-class CyclotronManager {- config;- constructor(config) {- this.config = config;- this.config = config;- }- async connect() {- const config = {- shards: this.config.shards.map((shard) => (0, helpers_1.convertToInternalPoolConfig)(shard)),- shardDepthLimit: this.config.shardDepthLimit,- shardDepthCheckIntervalSeconds: this.config.shardDepthCheckIntervalSeconds,- shouldCompressVmState: this.config.shouldCompressVmState,- shouldUseBulkJobCopy: this.config.shouldUseBulkJobCopy,- };- return await cyclotron.maybeInitManager(JSON.stringify(config));- }- async createJob(job) {- job.priority ??= 1;- job.scheduled ??= new Date().toISOString();- const jobInitInternal = {- id: job.id,- team_id: job.teamId,- function_id: job.functionId,- queue_name: job.queueName,- priority: job.priority,- scheduled: job.scheduled,- vm_state: job.vmState ? (0, helpers_1.serializeObject)('vmState', job.vmState) : null,- parameters: job.parameters ? (0, helpers_1.serializeObject)('parameters', job.parameters) : null,- metadata: job.metadata ? (0, helpers_1.serializeObject)('metadata', job.metadata) : null,- };- const json = JSON.stringify(jobInitInternal);- return await cyclotron.createJob(json, job.blob ? job.blob : undefined);- }- async bulkCreateJobs(jobs) {- const jobInitsInternal = jobs.map((job) => {- job.priority ??= 1;- job.scheduled ??= new Date().toISOString();- return {- id: job.id,- team_id: job.teamId,- function_id: job.functionId,- queue_name: job.queueName,- priority: job.priority,- scheduled: job.scheduled,- vm_state: job.vmState ? (0, helpers_1.serializeObject)('vmState', job.vmState) : null,- parameters: job.parameters ? (0, helpers_1.serializeObject)('parameters', job.parameters) : null,- metadata: job.metadata ? (0, helpers_1.serializeObject)('metadata', job.metadata) : null,- };- });- const json = JSON.stringify(jobInitsInternal);- const totalBytes = jobs.reduce((total, job) => total + (job.blob ? job.blob.byteLength : 0), 0);- const blobs = new Uint8Array(totalBytes);- const blobLengths = new Uint32Array(jobs.length);- let offset = 0;- for (let i = 0; i < jobs.length; i++) {- const blob = jobs[i].blob;- if (blob) {- blobLengths[i] = blob.byteLength;- blobs.set(blob, offset);- offset += blob.byteLength;- }- else {- blobLengths[i] = 0;- }- }- return await cyclotron.bulkCreateJobs(json, blobs, blobLengths);- }-}-exports.CyclotronManager = CyclotronManager;-//# sourceMappingURL=manager.js.map\ No newline at end of filediff --git a/rust/cyclotron-node/dist/manager.js.map b/rust/cyclotron-node/dist/manager.js.mapdeleted file mode 100644index 541eac7c587f..000000000000--- a/rust/cyclotron-node/dist/manager.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"manager.js","sourceRoot":"","sources":["../src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IACnE,CAAC;CACJ;AA7ED,4CA6EC"}\ No newline at end of filediff --git a/rust/cyclotron-node/dist/types.d.ts b/rust/cyclotron-node/dist/types.d.tsdeleted file mode 100644index 10c00c35d926..000000000000--- a/rust/cyclotron-node/dist/types.d.ts+++ /dev/null@@ -1,39 +0,0 @@-export type CyclotronPoolConfig = {- dbUrl: string;- maxConnections?: number;- minConnections?: number;- acquireTimeoutSeconds?: number;- maxLifetimeSeconds?: number;- idleTimeoutSeconds?: number;-};-export type CyclotronInternalPoolConfig = {- db_url: string;- max_connections?: number;- min_connections?: number;- acquire_timeout_seconds?: number;- max_lifetime_seconds?: number;- idle_timeout_seconds?: number;-};-export type CyclotronJobState = 'available' | 'running' | 'completed' | 'failed' | 'paused' | 'canceled';-export type CyclotronJob = {- id: string;- teamId: number;- functionId: string | null;- created: Date;- lockId: string | null;- lastHeartbeat: Date | null;- janitorTouchCount: number;- transitionCount: number;- lastTransition: Date;- queueName: string;- state: CyclotronJobState;- priority: number;- scheduled: string | null;- parentRunId: string | null;- vmState: object | null;- metadata: object | null;- parameters: object | null;- blob: Uint8Array | null;-};-export type CyclotronJobInit = Pick<CyclotronJob, 'teamId' | 'functionId' | 'queueName' | 'priority'> & Pick<Partial<CyclotronJob>, 'id' | 'scheduled' | 'parentRunId' | 'vmState' | 'parameters' | 'metadata' | 'blob'>;-export type CyclotronJobUpdate = Pick<Partial<CyclotronJob>, 'queueName' | 'priority' | 'parentRunId' | 'vmState' | 'parameters' | 'metadata' | 'blob' | 'scheduled'>;diff --git a/rust/cyclotron-node/dist/types.js b/rust/cyclotron-node/dist/types.jsdeleted file mode 100644index 11e638d1ee44..000000000000--- a/rust/cyclotron-node/dist/types.js+++ /dev/null@@ -1,3 +0,0 @@-"use strict";-Object.defineProperty(exports, "__esModule", { value: true });-//# sourceMappingURL=types.js.map\ No newline at end of filediff --git a/rust/cyclotron-node/dist/types.js.map b/rust/cyclotron-node/dist/types.js.mapdeleted file mode 100644index c768b7900261..000000000000--- a/rust/cyclotron-node/dist/types.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}\ No newline at end of filediff --git a/rust/cyclotron-node/dist/worker.d.ts b/rust/cyclotron-node/dist/worker.d.tsdeleted file mode 100644index d49995ecb919..000000000000--- a/rust/cyclotron-node/dist/worker.d.ts+++ /dev/null@@ -1,34 +0,0 @@-import { CyclotronJob, CyclotronJobState, CyclotronJobUpdate, CyclotronPoolConfig } from './types';-type CyclotronWorkerNodeConfig = {- pool: CyclotronPoolConfig;- queueName: string;- batchMaxSize?: number;- includeVmState?: boolean;- pollDelayMs?: number;- heartbeatTimeoutMs?: number;- includeEmptyBatches?: boolean;-};-type CyclotronWorkerInternalConfig = {- heartbeatTimeoutMs?: number;- heartbeatWindowSeconds?: number;- lingerTimeMs?: number;- maxUpdatesBuffered?: number;- maxBytesBuffered?: number;- flushLoopIntervalMs?: number;- shouldCompressVmState?: boolean;-};-export type CyclotronWorkerConfig = CyclotronWorkerNodeConfig & CyclotronWorkerInternalConfig;-export declare class CyclotronWorker {- private config;- isConsuming: boolean;- lastHeartbeat: Date;- private consumerLoopPromise;- constructor(config: CyclotronWorkerConfig);- isHealthy(): boolean;- connect(processBatch: (jobs: CyclotronJob[]) => Promise<void>): Promise<void>;- private startConsumerLoop;- disconnect(): Promise<void>;- releaseJob(jobId: string): Promise<void>;- updateJob(id: CyclotronJob['id'], state: CyclotronJobState, updates?: CyclotronJobUpdate): void;-}-export {};diff --git a/rust/cyclotron-node/dist/worker.js b/rust/cyclotron-node/dist/worker.jsdeleted file mode 100644index ee56e3e5756c..000000000000--- a/rust/cyclotron-node/dist/worker.js+++ /dev/null@@ -1,102 +0,0 @@-"use strict";-Object.defineProperty(exports, "__esModule", { value: true });-exports.CyclotronWorker = void 0;-const cyclotron = require('../index.node');-const helpers_1 = require("./helpers");-const parseJob = (job) => {- return {- ...job,- vmState: (0, helpers_1.deserializeObject)('vmState', job.vmState),- metadata: (0, helpers_1.deserializeObject)('metadata', job.metadata),- parameters: (0, helpers_1.deserializeObject)('parameters', job.parameters),- };-};-class CyclotronWorker {- config;- isConsuming = false;- lastHeartbeat = new Date();- consumerLoopPromise = null;- constructor(config) {- this.config = config;- }- isHealthy() {- return (this.isConsuming &&- new Date().getTime() - this.lastHeartbeat.getTime() < (this.config.heartbeatTimeoutMs ?? 30000));- }- async connect(processBatch) {- if (this.isConsuming) {- throw new Error('Already consuming');- }- const config = {- heartbeatWindowSeconds: this.config.heartbeatWindowSeconds ?? 5,- lingerTimeMs: this.config.lingerTimeMs ?? 500,- maxUpdatesBuffered: this.config.maxUpdatesBuffered ?? 100,- maxBytesBuffered: this.config.maxBytesBuffered ?? 10000000,- flushLoopIntervalMs: this.config.flushLoopIntervalMs ?? 10,- shouldCompressVmState: this.config.shouldCompressVmState ?? false,- };- await cyclotron.maybeInitWorker(JSON.stringify((0, helpers_1.convertToInternalPoolConfig)(this.config.pool)), JSON.stringify(config));- this.isConsuming = true;- this.consumerLoopPromise = this.startConsumerLoop(processBatch).finally(() => {- this.isConsuming = false;- this.consumerLoopPromise = null;- });- }- async startConsumerLoop(processBatch) {- try {- this.isConsuming = true;- const batchMaxSize = this.config.batchMaxSize ?? 100;- const pollDelayMs = this.config.pollDelayMs ?? 50;- while (this.isConsuming) {- this.lastHeartbeat = new Date();- const jobs = (this.config.includeVmState- ? await cyclotron.dequeueJobsWithVmState(this.config.queueName, batchMaxSize)- : await cyclotron.dequeueJobs(this.config.queueName, batchMaxSize)).map(parseJob);- if (!jobs.length) {- await new Promise((resolve) => setTimeout(resolve, pollDelayMs));- if (this.config.includeEmptyBatches) {- await processBatch(jobs);- }- continue;- }- await processBatch(jobs);- }- }- catch (e) {- console.error('[Cyclotron] Error in worker loop', e);- }- }- async disconnect() {- this.isConsuming = false;- await (this.consumerLoopPromise ?? Promise.resolve());- }- async releaseJob(jobId) {- return cyclotron.releaseJob(jobId);- }- updateJob(id, state, updates) {- cyclotron.setState(id, state);- if (updates?.queueName !== undefined) {- cyclotron.setQueue(id, updates.queueName);- }- if (updates?.priority !== undefined) {- cyclotron.setPriority(id, updates.priority);- }- if (updates?.parameters !== undefined) {- cyclotron.setParameters(id, (0, helpers_1.serializeObject)('parameters', updates.parameters));- }- if (updates?.metadata !== undefined) {- cyclotron.setMetadata(id, (0, helpers_1.serializeObject)('metadata', updates.metadata));- }- if (updates?.vmState !== undefined) {- cyclotron.setVmState(id, (0, helpers_1.serializeObject)('vmState', updates.vmState));- }- if (updates?.blob !== undefined) {- cyclotron.setBlob(id, updates.blob);- }- if (updates?.scheduled !== undefined) {- cyclotron.setScheduledAt(id, updates.scheduled);- }- }-}-exports.CyclotronWorker = CyclotronWorker;-//# sourceMappingURL=worker.js.map\ No newline at end of filediff --git a/rust/cyclotron-node/dist/worker.js.map b/rust/cyclotron-node/dist/worker.js.mapdeleted file mode 100644index 2287073fb09d..000000000000--- a/rust/cyclotron-node/dist/worker.js.map+++ /dev/null@@ -1 +0,0 @@-{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";;;AACA,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AAC1C,uCAA2F;AAQ3F,MAAM,QAAQ,GAAG,CAAC,GAAiB,EAAgB,EAAE;IACjD,OAAO;QACH,GAAG,GAAG;QACN,OAAO,EAAE,IAAA,2BAAiB,EAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC;QAClD,QAAQ,EAAE,IAAA,2BAAiB,EAAC,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC;QACrD,UAAU,EAAE,IAAA,2BAAiB,EAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC;KAC9D,CAAA;AACL,CAAC,CAAA;AAwCD,MAAa,eAAe;IAMJ;IALpB,WAAW,GAAY,KAAK,CAAA;IAC5B,aAAa,GAAS,IAAI,IAAI,EAAE,CAAA;IAExB,mBAAmB,GAAyB,IAAI,CAAA;IAEx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OAAO,CAAC,IAAI,CAAC,CAAA;QACvC,CAAC;QACD,IAAI,OAAO,EAAE,SAAS,KAAK,SAAS,EAAE,CAAC;YACnC,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;QACnD,CAAC;IACL,CAAC;CACJ;AA5GD,0CA4GC"}\ No newline at end of filediff --git a/rust/cyclotron-node/index.node b/rust/cyclotron-node/index.nodedeleted file mode 100755index ea697c78d1cd..000000000000Binary files a/rust/cyclotron-node/index.node and /dev/null differ