https://www.lunasec.io logo
Join Slack
Powered by
# building-the-lunasec-stack
  • d

    Donald Pinckney

    10/12/2022, 12:49 AM
    Yes, we have it all locally. But we’re probably going to move it offsite at some point
  • d

    Donald Pinckney

    10/12/2022, 12:49 AM
    working out what that should be
  • f

    Free Wortley

    10/12/2022, 7:51 PM
    @Donald Pinckney Chris (@breadchris) ported your code to Golang so that we could run it in our backend. We're getting the replication running right now. 🙏🏻 https://github.com/lunasec-io/lunasec/pull/930 How would you prefer to be credited for that? We can obviously cite you in the source code, but is there anywhere else?
  • d

    Donald Pinckney

    10/12/2022, 7:57 PM
    Cool work!
  • d

    Donald Pinckney

    10/12/2022, 7:59 PM
    Also, I’ve found that the change listener is somewhat unsustainable as-is for us, because it has this dumb n^2 growth problem
  • b

    breadchris

    10/12/2022, 8:01 PM
    yeah, man, this changes endpoint is wild lol
  • d

    Donald Pinckney

    10/12/2022, 8:01 PM
    I.e.: Change 0: Package P has versions V1 Change 1: Package P has versions V1, V2 Change 2: Package P has versions V1, V2, V3
  • d

    Donald Pinckney

    10/12/2022, 8:02 PM
    That’s what you receive via the endpoint
  • d

    Donald Pinckney

    10/12/2022, 8:02 PM
    So if you store it all it’s this bad quadratic growth
  • d

    Donald Pinckney

    10/12/2022, 8:02 PM
    What I’m hacking on now is computing and storing a diff for each change
  • d

    Donald Pinckney

    10/12/2022, 8:03 PM
    Idk how else to credit me other than mentioning me in the source code
  • b

    breadchris

    10/12/2022, 8:47 PM
    yeah ill link to your implementation in the code
  • b

    breadchris

    10/12/2022, 8:47 PM
    it was really well written dude, we aren't replicating the blobs, but your architecture looks really well thought out
  • b

    breadchris

    10/12/2022, 8:47 PM
    i thought this part of the code was funny
  • b

    breadchris

    10/12/2022, 8:48 PM
    https://github.com/donald-pinckney/npm-follower/blob/a35709a641db2284e6e1863fcbc0b5d62657d8ec/postgres_db/src/change_log.rs#L62
  • b

    breadchris

    10/12/2022, 8:48 PM
    where you wrote a state machine to filter out null sequences
  • b

    breadchris

    10/12/2022, 8:48 PM
    i ended up doing that on ingestion so i didnt have to serialize, filter, and then re-deserialize
  • d

    Donald Pinckney

    10/12/2022, 8:49 PM
    Ah yeah that was some wild bs with Postgres’s json data type
  • b

    breadchris

    10/12/2022, 8:49 PM
    https://github.com/lunasec-io/lunasec/blob/448fd165e0d9fccc75af7608fca8fec5f5c6144b/lunatrace/bsl/ingest-worker/pkg/metadata/replicator/npm.go#L167
  • b

    breadchris

    10/12/2022, 8:49 PM
    not as efficient as your state machine lol
  • b

    breadchris

    10/12/2022, 8:49 PM
    but i got to save the ser/deser
  • b

    breadchris

    10/12/2022, 8:50 PM
    oh yeah jesus the growth is horrible
  • b

    breadchris

    10/12/2022, 8:50 PM
    i am totally just ignoring the docs that are > 30mb lol
  • b

    breadchris

    10/12/2022, 8:50 PM
    https://github.com/lunasec-io/lunasec/blob/448fd165e0d9fccc75af7608fca8fec5f5c6144b/lunatrace/bsl/ingest-worker/pkg/metadata/replicator/npm.go#L143
  • s

    Slackbot

    10/12/2022, 8:51 PM
    This message was deleted.
    f
    • 2
    • 2
  • f

    Free Wortley

    10/12/2022, 10:28 PM
    @Donald Pinckney ^
  • d

    Donald Pinckney

    10/22/2022, 1:04 AM
    I looked at the all docs endpoint a little bit
  • d

    Donald Pinckney

    10/22/2022, 1:06 AM
    I `curl`ed it and it just kept downloading for a few hours, so i got tired and killed it. Seemed like the changes thing was simpler, though a bit wacky
  • s

    Slackbot

    10/25/2022, 7:27 AM
    This message was deleted.
    f
    • 2
    • 1
  • m

    Maurice Bigirimana

    10/25/2022, 7:28 AM
    It would really be helpful