My thoughts on & questions about the current state of Cloud

default discord avatar
thedunco
7 months ago
11

So I was tasked with looking into Payload Cloud for my company. We aren't considering moving to using it any time soon, but we wanted to see how it currently works.



Our biggest questions were...


1. If our Payload API server goes down, can we read from a cache somewhere


- The answer appears to be "yes" because of CloudFlare


- Is that accurate?



2. What's Cloud's tech stack?


- Digital Ocean


- CloudFlare


- What else?



I then attempted to deploy our site (Next.js Turbo monorepo containing our ecommerce site's Next.js code, our Payload CMS instance, and shared packages using pnpm as the package manager). A couple of notes for the team that I came across...


- If I'm on

https://payloadcms.com/cloud/

<team>/<project> while the app is building/failing to build, I don't see a way to get to the project settings page besides appending /settings to the url. Might I suggest adding a link to the settings page here?


- I haven't been able to get things to build because, even after adding

corepack enable

to the install command, the container tries to look for

package-lock.json

or

yarn.lock

but doesn't seem to support pnpm's

pnpm-lock.yml

lockfile (error pictured).


- Are there plans to incorporate an environment variable import functionality? Or more/better/faster ways to add environment variables to the project? I'd suggest looking into how Railway does this and providing multiple different options.


- I can't seem to see all of my branches on GitHub, so I'm not sure if the integration is broken or what's up. I couldn't see our

main

branch so I left the option blank and it auto-selected the branch but still hasn't been able to build.



Anyway, those are my current thoughts and concerns and questions. I'll post more here if I figure anything out. Thanks team for any help/feedback you can provide!

  • discord user avatar
    denolfe
    Payload Team
    7 months ago

    Hey @thedunco , thanks for trying cloud out! Posts like these really help us improve the platform.



    We're aware of most of the issues that you've mentioned. Let me address each one:



    If our Payload API server goes down, can we read from a cache somewhere

    Every Payload Cloud project uses the CloudFlare CDN, and yes, that is my understanding. I'll have someone else on the team give a more in-depth response on this one.



    What's Cloud's tech stack?

    - Digital Ocean


    - CloudFlare


    - MongoDB Atlas


    - AWS S3



    If I'm on https://payloadcms.com/cloud/<team>/<project> while the app is building/failing to build, I don't see a way to get to the project settings page besides appending /settings to the url. Might I suggest adding a link to the settings page here?

    A change to allow access to the Settings tab at all times is in progress and should be released shortly.



    I haven't been able to get things to build because, even after adding corepack enable to the install command, the container tries to look for package-lock.json or yarn.lock but doesn't seem to support pnpm's pnpm-lock.yml lockfile (error pictured)

    Thank you for bringing this one up, we will look into what needs to be done to support pnpm 👍



    Are there plans to incorporate an environment variable import functionality? Or more/better/faster ways to add environment variables to the project? I'd suggest looking into how Railway does this and providing multiple different options.

    We've discussed a way to bulk import env vars and can prioritize this. Looks like Railway had a "Raw editor" like an .env file.



    I can't seem to see all of my branches on GitHub, so I'm not sure if the integration is broken or what's up. I couldn't see our main branch so I left the option blank and it auto-selected the branch but still hasn't been able to build.

    Early on, we had issues with people selecting non-existent branches, so we now fetch the available branches from the repo to select from. Are you saying that it's not fetching some but not all of your branches? What branches were showing as available if any?

  • default discord avatar
    thedunco
    7 months ago

    No problem, thanks for the detailed response! It isn't showing me our

    main

    or

    develop

    branches which are the main ones we use besides individual feature branches, and

    it looks like it's only showing me branches with all uppercase branch names

    (most of which for us are old and probably should be deleted).

    image.png
  • discord user avatar
    denolfe
    Payload Team
    7 months ago

    Interesting, not sure on the all caps thing. Do you have a large number of branches in this repo?

  • default discord avatar
    thedunco
    7 months ago

    Yes, a ton



    Probably really do need to clean them up

  • discord user avatar
    denolfe
    Payload Team
    7 months ago

    I'll take a look at how we're handling that. It might be a pagination thing on our end when we fetch them 👍

  • default discord avatar
    thedunco
    7 months ago

    Roger that, thanks for looking into it!



    It's showing me exactly 30 results

  • discord user avatar
    denolfe
    Payload Team
    7 months ago

    Got it, I'll get this looked at on our end

  • default discord avatar
    emirotin
    6 months ago

    Hi @denolfe, is there any update on the pnpm support? It would be extremely helpful for us


    Some background:


    - we're using the Cloud


    - currently our CMS is in a separate repo with yarn, it works


    - we'd love to move it into our main monorepo, specifically to be able to directly use the generated types in other projects (but also to reuse share ESLint, TS configs, and send a single PR touching both the CMS and the site


    - similar to @thedunco, I've tried setting the

    install

    command to

    corepack enable && corepack prepare pnpm@8.5.1 --activate && pnpm install

    , but it seems to be completely ignored by the buildpack



    I also have a dockerfile which I would be OK to use, but I don't see the way to let DO know it should deploy from it

  • discord user avatar
    denolfe
    Payload Team
    6 months ago

    Hey @emirotin , we discussed this with DO. It looks like using a Dockerfile is actually the only way to get this to work with pnpm. The buildpacks that DO uses try to be too smart, and unfortunately, DO doesn't support custom buildpacks (of which there is one for pnpm)



    At this point in time, we haven't exposed a way for the Payload Cloud project to specify a dockerfile to deploy. This would need to be added and tested. The resulting dockerfile you would need would look similar to what this article specifies:

    https://medium.com/coding-spark/a-digitalocean-configuration-to-deploy-pnpm-based-backend-applications-f6d407a27206

    We haven't quite prioritized working on this, but I imagine we'd be able to slot it in the sprint after next (in 2 weeks).

  • default discord avatar
    emirotin
    6 months ago

    Thanks for the reply. I already have a building dockerfile, but as you've mentioned no way to hook it. I have even tried adding the

    .do

    folder 🙂

  • default discord avatar
    mattddean
    5 months ago

    This is full of hacky Payload Cloud deployment workarounds, but I think it's a good example of how good pnpm/turborepo are for monorepos.


    This one in particular uses turborepo to manage generated file dependencies between the different apps.


    The end result is that you just run

    pnpm dev

    and everything runs in the right order.



    On the deployment side, I'm looking forward to official pnpm support in Payload Cloud so I can avoid the workarounds!


    https://github.com/mattddean/payloadcms-nextjs-pnpm-monorepo
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.