by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mark Terrel
    @mterrel
    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.
    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.
    Tom Dyas
    @tdyas
    make cleaner && make build fails due to no access to adapt-web repo:
    git clone git@gitlab.com:unboundedsystems/adapt-web.git web
    Cloning into 'web'...
    Warning: Permanently added the ECDSA host key for IP address '172.65.251.78' to the list of known hosts.
    Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    /src/config/build_support/web.mk:30: recipe for target 'web/.git' failed
    make: *** [web/.git] Error 128
    make: *** [/home/tdyas/Projects/Adapt/adapt/config/build_support/dockerize.mk:36: .DOCKER_MAKE_DONE] Error 2
    Mark Terrel
    @mterrel
    Ok, I'll file a bug for that. I think it's not actually a permissions error in this case, despite the message. Try cloning it manually. So from the adapt repo directory: git clone git@gitlab.com:unboundedsystems/adapt-web.git web
    Oh, I may have spoken too soon. It may be a permissions problem. Investigating and fixing...
    Mark Terrel
    @mterrel
    Ok, adapt-web should be public now. Try make build again. It is somewhat possible that it still gives a permissions error in that context though. If you still see the permissions error, try the manual clone as suggested above. And either way, let me know how that goes and I'll file a bug if needed.
    Tom Dyas
    @tdyas
    I had to manually clone. Maybe the ssh key to authenticate with is not being passed into whatever Docker container things are running in?
    Mark Terrel
    @mterrel
    Yes, that's probably the case.
    Rahul Saxena
    @rksio_twitter
    Mark Terrel
    @mterrel
    Looks interesting. Sounds like a lot of custom work to pull all that together.
    Kirk Ross
    @kirkbross_gitlab

    kirkb@DESKTOP-5BF58I3 MINGW64 /e/Sites/wud/deploy

    $ adapt run k8s-test --deployID app-test
    [13:23:59] Installing node modules [started]
    [13:24:02] Installing node modules [failed]
    [13:24:02] → EBUSY: resource busy or locked, rmdir 'E:\Sites\wud\deploy'
    Error: EBUSY: resource busy or locked, rmdir 'E:\Sites\wud\deploy'
    Code: EBUSY

    Adapt version: 0.3.1
    Mark Terrel
    @mterrel
    Hi Kirk! Thanks for getting this info. Sorry again you're seeing this problem.
    Kirk Ross
    @kirkbross_gitlab
    Node version 12.18 .3
    Windows 10
    GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)
    Mark Terrel
    @mterrel
    Hmm... We haven't done a lot of testing under Windows, so I suspect it's some issue in that general area.
    Do you have any yarn-related configuration anywhere, like maybe a yarnrc file?
    Kirk Ross
    @kirkbross_gitlab
    globally you mean?
    Mark Terrel
    @mterrel
    Yep, globally or in your home directory
    Kirk Ross
    @kirkbross_gitlab
    .yarnrc

    THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
    yarn lockfile v1

    lastUpdateCheck 1599800732820

    not much in there
    Mark Terrel
    @mterrel
    Ok, great. I'd like to try to reproduce this on my system. Can I get back to you in maybe an hour or so?
    Kirk Ross
    @kirkbross_gitlab
    Sure... do you have a Windows machine or VM?
    Mark Terrel
    @mterrel
    Yep, I do
    Kirk Ross
    @kirkbross_gitlab
    sweet. thx
    Mark Terrel
    @mterrel
    Oh, wait..one more question for you: You're using MinGW, right?
    I suspect the issue is with Windows generally, not MinGW. But just to check, if you could open either a regular Windows CMD shell or a PowerShell and run that Adapt command again, that would confirm.
    Kirk Ross
    @kirkbross_gitlab
    yes
    MINGW64