Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ergomake #864

Merged
merged 1 commit into from
Jun 27, 2023
Merged

Ergomake #864

merged 1 commit into from
Jun 27, 2023

Conversation

vieiralucas
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Jun 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agent-gpt 🔄 Building (Inspect) Jun 27, 2023 5:46am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 27, 2023 5:46am

@vercel
Copy link

vercel bot commented Jun 26, 2023

@vieiralucas is attempting to deploy a commit to the reworkd Team on Vercel.

A member of the Team first needs to authorize it.

@vercel vercel bot temporarily deployed to Preview – docs June 26, 2023 14:58 Inactive
@vieiralucas vieiralucas reopened this Jun 26, 2023
@vieiralucas vieiralucas reopened this Jun 26, 2023
@vieiralucas vieiralucas reopened this Jun 26, 2023
@vieiralucas vieiralucas reopened this Jun 26, 2023
@ergomake
Copy link

ergomake bot commented Jun 26, 2023

Hi 👋

Here's a preview environment 🚀

https://next-reworkd-agentgpt-864.env.ergomake.link

Environment Summary 📑

Container Source URL
next Dockerfile https://next-reworkd-agentgpt-864.env.ergomake.link
docs Dockerfile https://docs-reworkd-agentgpt-864.env.ergomake.link
platform Dockerfile https://platform-reworkd-agentgpt-864.env.ergomake.link
db Dockerfile [not exposed - internal service]
weaviate semitechnologies/weaviate:1.19.6 https://weaviate-reworkd-agentgpt-864.env.ergomake.link

Questions? Comments? Suggestions? Join Discord.

Click here to disable Ergomake.

@vercel vercel bot temporarily deployed to Preview – docs June 26, 2023 21:48 Inactive
@vieiralucas vieiralucas reopened this Jun 26, 2023
@vieiralucas vieiralucas reopened this Jun 26, 2023
Comment on lines 9 to 12
NEXT_PUBLIC_BACKEND_URL: 'http://localhost:8000'
NEXTAUTH_URL: "http://localhost:3000"
DATABASE_URL: "mysql://reworkd_platform:reworkd_platform@db:3307/reworkd_platform"
NEXTAUTH_SECRET: "changeme"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way to simply pass an env into the ergomake env?

Comment on lines 25 to 28
volumes:
- ./platform:/app/src/
env_file:
- next/.env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we're removing this?

@@ -0,0 +1,15 @@
FROM node:19-alpine
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Needed this :)

next/Dockerfile Outdated
Comment on lines 8 to 18
ARG NEXT_PUBLIC_BACKEND_URL
ENV NEXT_PUBLIC_BACKEND_URL=$NEXT_PUBLIC_BACKEND_URL

ARG NEXTAUTH_URL
ENV NEXTAUTH_URL=$NEXTAUTH_URL

ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL

ARG NEXTAUTH_SECRET
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
Copy link
Contributor

@asim-shrestha asim-shrestha Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we don't have this. It introduces another vector that we might need to update whenever a new env variable is introduced. It would be cool to have a Vercel style workflow of adding ENV values to a project

next/Dockerfile Outdated
Comment on lines 45 to 39

# Expose the port the app will run on
EXPOSE 3000

ENTRYPOINT ["sh", "/entrypoint.sh"]

# Start the application
CMD ["npm", "run", "dev"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we don't build here. I personally use this for dev and require hot reloads :)

@asim-shrestha
Copy link
Contributor

Thanks @vieiralucas! Left some comments - looking forward to getting this up and running!

@vercel vercel bot temporarily deployed to Preview – docs June 27, 2023 04:35 Inactive
@vieiralucas
Copy link
Contributor Author

vieiralucas commented Jun 27, 2023

@asim-shrestha I moved every customization to inside the .ergomake folder.

The thing about .env is that it is not commited into the source, so it works great when you're running locally, but ergomake can't build the compose when it performs a "fresh" clone.

Running things in dev mode is problematic because it usually needs too much resources and/or reduces the performance too much.

Finally, since every preview has its own link, we need a mechanism to customize the backend url that the frontend uses, also customize the origins the backend accept cors, etc.

So, for these reasons I made some changes to the compose and dockerfiles.

That said, I completely agree that these things should not interfere on how developers wants to runs things on their machines, it makes sense, my bad for not thiking about that.

I can definetly see how we can add a set of features to ergomake to try to avoid some of these customizations, but nowadays that would be the way to integrate ergomake with AgentGPT. The best alternative we have to avoid messing with the existing files atm is to put things inside .ergomake.

@vercel vercel bot temporarily deployed to Preview – docs June 27, 2023 05:46 Inactive
@asim-shrestha
Copy link
Contributor

Thanks @vieiralucas!

@asim-shrestha I moved every customization to inside the .ergomake folder.

Perfect :)

Running things in dev mode is problematic because it usually needs too much resources and/or reduces the performance too much.

Ah, makes sense

The thing about .env is that it is not committed into the source, so it works great when you're running locally, but ergomake can't build the compose when it performs a "fresh" clone.
Finally, since every preview has its own link, we need a mechanism to customize the backend url that the frontend uses, also customize the origins the backend accept cors, etc.
So, for these reasons I made some changes to the compose and dockerfiles.

I think the changes such as the mappings of env to the ergomake variables make sense given this, the ideal for us is that we'd be able to create our own .ergomake.env or something that we store in your cloud (Or manage on the web with something like Vercel's ENV editor)

We'll try to review and get this in later today!

@awtkns
Copy link
Contributor

awtkns commented Jun 27, 2023

Looks good to me! I like how it is clean and separated! I think we can merge then iterate should the need arise.

@awtkns awtkns merged commit d77618c into reworkd:main Jun 27, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants