by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Rahul Saxena
    @rksio_twitter
    BTW, Architecture B is what we had at my previous startup. Only addition was an additional Postgres connection.
    Rahul Saxena
    @rksio_twitter
    Have you seen this service: https://bullettrain.co/ — scaffolding RoR as service. I wonder what they use in the backend. — is it valuable to them to have adaptjs based backend instantiation...
    Rahul Saxena
    @rksio_twitter
    What do you all think of applying component based approach to CI systems. Look at this stuff: https://www.branchci.com/
    Manish Vachharajani
    @mvachhar
    How different is this from something like Spinnaker?
    Generally, I am not a fan of GUI-only experiences for configuring complex things. Eventually, it becomes easier to see what is happening with a text interface, perhaps with a nice visualization of things to go along with it.
    Rahul Saxena
    @rksio_twitter
    I was looking at this website as an example of a need to deploy and update well known “Applications”. — Branch CI appears to be able to update and deploy the Wordpress Application. A component and dependency based model like Adapt might be useful to deploy Applications as well as underlying infrastructure. Perhaps there are cases where App deployment is more complex than instantiation if underlying infrastructure? (mostly thinking out aloud)
    Manish Vachharajani
    @mvachhar
    Agreed, although I think a GUI approach may be best for app deployment. This isn't something we're targeting explicitly, but if some folks in the community want to build such components, we'd be all in on helping them do so.
    William Kasel
    @Wkasel

    Hey guys, thanks for the great product. I am working through converting an existing app of mine to Adapt, and had a few questions:

    1.) What version of node is currently supported?
    2.) Are you using node alpine, or what specific image?
    3.) What is the default script ran when deployed?

    Mark Terrel
    @mterrel
    Hi @Wkasel, I'm glad you're liking Adapt so far!
    The current latest version of Adapt, v0.1.0, requires that the system you run it on uses Node 10. But we've added support for Node 12 and 13 in the next version. To upgrade your Adapt CLI and any projects you've created to next, follow the instructions here
    Mark Terrel
    @mterrel
    For your second question, I'm guessing you're asking about the version of Node used when building your app?
    If so, <LocalNodeImage> is currently hard-coded to use node:10-stretch-slim. (And the NodeService and ReactApp components both use <LocalNodeImage>). However, the image should really be an option you can pass to any of those components so you can use any version you prefer.
    Mark Terrel
    @mterrel
    If you need a different version, you've got a couple of options:
    • Fastest: you can copy and paste the code for LocalNodeImage from the Adapt source into a file in your own project and modify the hard-coded image. You can then use a style sheet rule to substitute the LocalNodeImage from the cloud library to use your own local version instead. (Let me know and I can help you with the rule.)
    • I can also start working on adding the option to LocalNodeImage so you can use it. Let me know if you need this quickly and I'll get working on it.
    • Or, if you'd like to submit a PR that updates LocalNodeImage to take a prop for its image, that would be awesome.
    Mark Terrel
    @mterrel

    I'm guessing that your third question is also about LocalNodeImage. So the short answer is that it runs npm run build by default.

    But that actually is configurable. If you're using LocalNodeImage directly, you can control both which package manager to use (npm is default) and what scripts to run. Here's an example:

    <LocalNodeImage srcDir="../frontend"  options={{ packageManager: "yarn" runNpmScripts: [ "setup", "build" ] }} />
    You can check out some of these docs for more info:
    Mark Terrel
    @mterrel
    Oops, I just noticed there's a comma missing, just before runNpmScripts in the example above.
    Tarrence van As
    @tarrencev
    are there any examples of deploying an application to gcloud and serving over an https endpoint?
    Mark Terrel
    @mterrel
    Hi @tarrencev ! We have an article that describes how to use GKE here: https://adaptjs.org/blog/2020/01/10/simple-hosting-react-app-on-google-cloud
    Let me know if that's not quite what you're looking for and we can help out.
    Tarrence van As
    @tarrencev
    taking a look now, thanks!
    Mark Terrel
    @mterrel
    No problem! Let me know if you have questions or need other help.
    Tarrence van As
    @tarrencev
    Is there a way to see more verbose logging during deploy? Seems i am stuck at ⠧ Deploying Docker image 'react-app' when building locally
    Tarrence van As
    @tarrencev
    I managed to get it working
    @mterrel i want to enable https for local development. is there a way to setup nginx to support this?
    Mark Terrel
    @mterrel
    Yes, there is logging, although it's not as great as we'd eventually like it to be. Currently, we use the Node.js debug module with the prefix adapt:. To see Docker related stuff during build:
    DEBUG=adapt:cloud:docker* adapt run ...
    That's the most verbose version of docker logging. Once you see the output, you can change the DEBUG= to show more or less stuff.
    If you really want a lot of output, use DEBUG=adapt*
    There isn't an existing example of setting up Nginx with HTTPS, but there definitely should be! If you'd like to contribute an example setup, that would be awesome. Either way though, we can help you get it set up if you'd like. There are Nginx components that should be a good starting point.
    Mark Terrel
    @mterrel
    If you'd like some help getting started with those, I can spend some time on it a little later in the day for you.
    But should be able to answer questions in the meantime too
    Tarrence van As
    @tarrencev
    @mterrel awesome i will take a look at that. hopefully last question. i have multiple servers listening in my node backend. how do i handle routing for this case? i.e. one server on 80 one on 90. i would like /api => 80 and /api2 => 90
    Mark Terrel
    @mterrel
    Ah, there's a UrlRouter component for that. The Nginx implementation of that component is here. And the getting started guide uses that component to route traffic for /api to an API backend service and routes everything else to a static HTTP server (also Nginx).
    To create a new adapt project that's a simple starting point that includes the UrlRouter: adapt new hello-react-node-postgres ./some_dir
    To see a slightly more full featured demo with it: adapt new moviedb-react-node ./some_other_dir
    Tarrence van As
    @tarrencev
    i see that. but if a single node instance is hosting two services it is unclear how to setup. if i do
    <NodeService port={80} handle={api} srcDir="../backend" />
    <NodeService port={90} handle={api2} srcDir="../backend" />
    would that create separate containers for each port?
    Mark Terrel
    @mterrel
    Yes, that would build two (identical) container images and run one of each.
    Hold on, lemme look at it for a sec...
    Mark Terrel
    @mterrel
    So in the UrlRouter routes prop, endpoint can be a string, so you could try to construct the right string URLs to put in there by using something like:
    const hostname = callInstanceMethod(api, undefined, "hostname");
    ...
    <UrlRouter port={8080} routes={[
      { path: "/api", endpoint: `http://${hostname}:80` },
      { path: "/api2", endpoint: `http://${hostname}:90` }
    ]} />
    I think that will work ok for local docker deploy. But in order to make it work in GKE, you'd need to copy and modify NodeService to allow it to take multiple ports to listen on so it correctly creates a NetworkService that corresponds to each of those also.
    Mark Terrel
    @mterrel
    And once again, if that's something you feel like you'd like to work on and contribute, that would be awesome. Or depending on how quickly you need it, we can probably get to doing it over the next few days.
    And maybe the dual NodeService can work for you in the short term?
    Tom Dyas
    @tdyas

    I'm getting a compile error when trying to run yarn build in the cloud/ directory:

    ~/Projects/Adapt/adapt/cloud$ yarn build
    yarn run v1.19.1
    $ tsc -p tsconfig.json
    src/aws/aws-sdk.ts:17:10 - error TS2305: Module '"../../../node_modules/@adpt/utils/dist/src"' has no exported member 'ciMaybeCreateLogger'.
    
    17 import { ciMaybeCreateLogger, ciReportEnabled, makeRetryDelay } from "@adpt/utils";
                ~~~~~~~~~~~~~~~~~~~
    
    src/aws/aws-sdk.ts:17:31 - error TS2305: Module '"../../../node_modules/@adpt/utils/dist/src"' has no exported member 'ciReportEnabled'.
    
    17 import { ciMaybeCreateLogger, ciReportEnabled, makeRetryDelay } from "@adpt/utils";
                                     ~~~~~~~~~~~~~~~
    
    src/aws/aws-sdk.ts:17:48 - error TS2305: Module '"../../../node_modules/@adpt/utils/dist/src"' has no exported member 'makeRetryDelay'.
    
    17 import { ciMaybeCreateLogger, ciReportEnabled, makeRetryDelay } from "@adpt/utils";
                                                      ~~~~~~~~~~~~~~
    
    
    Found 6 errors.
    
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    This is off of master at cb497355477d9bf0887555fd0110854fa54d580c plus some changes to add some code into cloud/aws/.

    Mark Terrel
    @mterrel
    Hi @tdyas , There are two things that are the most likely causes. The first one may be environment, tool, or dependency related and can be diagnosed by changing to the top level adapt repo directory and trying make cleaner; make build. That will do a complete cleanup, then build everything from scratch, using the containerized dev environment instead of your local system's tools and environment. Generally speaking, you shouldn't build or test using your system's native tools and environment, but rather use the containerized version of those, which can be found in the bin directory at the top level of the adapt repo. So instead of running yarn build in the cloud directory, you'd run ../bin/yarn build. And by using make instead of directly calling yarn, that ensures that dependencies have definitely been correctly (re-)built.
    If that doesn't build successfully, can you stash your cloud/aws changes and try make cleaner; make build again? Then, let me know the results and I can help you troubleshoot more from there.