apify / actor-monorepo-example Goto Github PK
View Code? Open in Web Editor NEWAn example repository with multiple Apify Actors sharing code between each other.
An example repository with multiple Apify Actors sharing code between each other.
I want to run in apify platform using this monorepo but its not working in the build project getting this error
I guess I issue is with ACTOR_PATH_IN_DOCKER_CONTEXT how to define it? I tried to add it in environment variable in apify but not working I gave the path as 1. ../actors/javascript-actor and 2. /actors/javascript-actor lastly I also tried this 3. actors/javascript-actor
Thanks for this useful project starter, I'm trying to get going but having some trouble. If someone could point out where I'm going wrong and/or where I should be looking in the Docs that would be great, thank you.
Some things I've tried:
cd actors/typescript-actor && apify run
seems to work:
[] ~/Dev/apify-actors/actors/typescript-actor <main> apify run
Run: npm start
> @actors/[email protected] start
> node --no-warnings --experimental-specifier-resolution=node --loader ../../module_loader.js src/index.ts
INFO System info {"apifyVersion":"3.1.7","apifyClientVersion":"2.7.1","crawleeVersion":"3.4.0","osType":"Darwin","nodeVersion":"v18.14.2"}
INFO JavaScript utils say: Hello from a TypeScript actor!
INFO TypeScript utils say: No message provided!
cd actors/typescript-actor && apify push
seems to lose access to parent folders
[] ~/Dev/apify-actors/actors/typescript-actor <main> apify push
Info: Deploying actor 'example-monorepo-actor-typescript' to Apify.
Run: Updated version 0.0 for example-monorepo-actor-typescript actor.
Run: Building actor example-monorepo-actor-typescript
2023-07-08T10:41:22.773Z ACTOR: ERROR: Actor context path "../../.." is outside of actor root directory!
2023-07-08T10:41:22.773Z ACTOR: ERROR: Actor context path "../../.." is outside of actor root directory!
Actor build detail -> https://console.apify.com/actors/THboJ0Kp2vfnWdJdZ#/builds/0.0.2
? Do you want to open the actor detail in your browser? Yes
Error: Build failed!
I thought maybe apify push
from the project root would resolve this, but it seems to create an empty/broken actor:
[] ~/Dev/apify-actors <main> apify push
Info: Created actor with name undefined on Apify.
Info: Deploying actor 'undefined' to Apify.
Run: Updated version 0.0 for my-actor actor.
Run: Building actor my-actor
2023-07-08T10:43:59.174Z ACTOR: Dockerfile not found, using the default one.
2023-07-08T10:43:59.182Z ACTOR: Extracting actor documentation from README.md
2023-07-08T10:43:59.185Z ACTOR: Did not find input schema at any of the default locations
2023-07-08T10:43:59.208Z ACTOR: Building Docker image.
2023-07-08T10:43:59.246Z Step 1/4 : FROM apify/actor-node:16
2023-07-08T10:43:59.474Z ---> ac7d12e8de1e
2023-07-08T10:43:59.476Z Step 2/4 : COPY . ./
2023-07-08T10:43:59.570Z ---> 98e2aed15b89
2023-07-08T10:43:59.572Z Step 3/4 : RUN npm install --quiet --only=prod --no-optional && (npm list || true)
2023-07-08T10:43:59.583Z ---> Running in f33d94016e16
2023-07-08T10:44:00.506Z npm
2023-07-08T10:44:00.508Z WARN config only Use `--omit=dev` to omit dev dependencies from the install.
2023-07-08T10:44:00.510Z
2023-07-08T10:44:00.513Z npm WARN
2023-07-08T10:44:00.514Z config optional Use `--omit=optional` to exclude optional dependencies, or
2023-07-08T10:44:00.517Z npm WARN
2023-07-08T10:44:00.519Z config
2023-07-08T10:44:00.521Z `--include=optional` to include them.
2023-07-08T10:44:00.523Z npm WARN
2023-07-08T10:44:00.525Z config
2023-07-08T10:44:00.528Z
2023-07-08T10:44:00.530Z
2023-07-08T10:44:00.532Z npm WARN config Default value does install optional deps unless otherwise omitted.
2023-07-08T10:44:00.534Z
2023-07-08T10:44:07.516Z added 5 packages, removed 133 packages, changed 11 packages, and audited 140 packages in 7s
2023-07-08T10:44:07.519Z 31 packages are looking for funding
2023-07-08T10:44:07.521Z run `npm fund` for details
2023-07-08T10:44:07.523Z 1 moderate severity vulnerability
2023-07-08T10:44:07.526Z To address all issues, run:
2023-07-08T10:44:07.528Z npm audit fix
2023-07-08T10:44:07.530Z Run `npm audit` for details.
2023-07-08T10:44:08.052Z [email protected] /usr/src/app
2023-07-08T10:44:08.054Z +-- @actors/[email protected] -> ./actors/javascript-actor
2023-07-08T10:44:08.056Z | +-- @packages/[email protected] deduped -> ./packages/javascript-utils
2023-07-08T10:44:08.059Z | `-- [email protected]
2023-07-08T10:44:08.061Z +-- @actors/[email protected] -> ./actors/typescript-actor
2023-07-08T10:44:08.063Z | +-- @packages/[email protected] deduped -> ./packages/javascript-utils
2023-07-08T10:44:08.069Z | +-- @packages/[email protected] deduped -> ./packages/typescript-utils
2023-07-08T10:44:08.075Z | `-- [email protected] deduped
2023-07-08T10:44:08.077Z +-- @packages/[email protected] -> ./packages/javascript-utils
2023-07-08T10:44:08.080Z | `-- @apify/[email protected]
2023-07-08T10:44:08.081Z `-- @packages/[email protected] -> ./packages/typescript-utils
2023-07-08T10:44:08.083Z `-- @apify/[email protected] deduped
2023-07-08T10:44:08.952Z Removing intermediate container f33d94016e16
2023-07-08T10:44:08.954Z ---> a33866cc294e
2023-07-08T10:44:08.956Z Step 4/4 : LABEL com.apify.actBuildId=8XbuAx6AGJdLwBVw1
2023-07-08T10:44:08.974Z ---> Running in 5549be4cebe8
2023-07-08T10:44:09.030Z Removing intermediate container 5549be4cebe8
2023-07-08T10:44:09.033Z ---> 2c39aeef9241
2023-07-08T10:44:09.035Z [Warning] One or more build-args [ACTOR_PATH_IN_DOCKER_CONTEXT] were not consumed
2023-07-08T10:44:09.038Z Successfully built 2c39aeef9241
2023-07-08T10:44:09.040Z Successfully tagged 031263542130.dkr.ecr.us-east-1.amazonaws.com/act-builds-prod-00155:8XbuAx6AGJdLwBVw1
2023-07-08T10:44:09.042Z ACTOR: Pushing Docker image to repository.
2023-07-08T10:44:11.050Z ACTOR: Build finished.
Actor build detail -> https://console.apify.com/actors/68cQMn1U29wVu81Dd#/builds/0.0.1
? Do you want to open the actor detail in your browser? Yes
Success: Actor was deployed to Apify cloud and built there.
and apify run
from the root is similar
Error: The "npm start" script was not found in package.json. Please set it up for your project. For more information about that call "apify help run".
The readme mentions:
To enable testing the TypeScript Actors locally without having to rebuild them or the TypeScript packages after every code change,
ts-node
along with thetsconfig-paths
loader is used. Sincetsconfig-paths
does not play well with ESM packages, a custom wrapper for the loader is used, defined inmodule_loader.js
.
but I'm lacking some context, do we need to run ts-node -r tsconfig-paths/register <which file?>
Documentation I've read:
The apify
CLI I installed via npm install -g apify-cli
and is version apify-cli/0.17.0 darwin-x64 node-v18.14.2
That's everything I can think of, please let you know if you need anything else. Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.