-
- Private work.
- re:Invent.
- Watched Swami’s keynote.
- New: Bedrock support for a few new models. Claude 2.1. Llama 2 70B.
- Titan text embeddings – converting text to numbers so you can train more efficiently on it.
- New: multimodal embeddings. Text, image, etc.
- New: Titan image generation. And they contain invisible watermarks for unique identification!
- Guest: Nyung Ho, vp ai from intuit. UI, UX, assistants, chat, infra, the expected.
- Vector databases for bedrock: opensearch, redis, pinecone.
- New: auroro, mongo, dynamo, documentdb vector support.
- New: Sagemaker Hyperpod. Train models faster.
- Guest: Aravind Srinivas, cofounder/ceo perplexity.
- New: Neptune analytics.
- New: Zero-ETL integration between opensearch and s3.
- Guest: Rob Francis, cto booking.com.
- Q can generate SQL for redshift from natural language. And it can create integrations with AWS glue (ETL).
- Guest: Shannon Kalisky, pm on quicksight.
- Lambda docs.
- Went through the lambda dependencies rigmarole.
- You can dynamically install at runtime. Easy, but slows down runtime, obviously (adding costs, hurting perf).
- You’re supposed to be able to add a
requirements.txt
to your lambda proj root, and it will autodetect and install. I’ve never seen this work.
- So you have the two main options remaining.
- The first is to zip up a hydrated environment and deploy that. Good if you have local testing + CICD set up. It can be folder install or venv. But it’s fast, because all the installed files / deps are already available at init and can be imported by your actual lambda function. But then you can’t use the online editor, etc.
- Best to go with layers. Same as above. Create a new layer, upload your zip (of the venv’s site-packages folder, with your deps installed, and name the venv “python” so the path is at
python/lib/python3.x/site-packages
), and then simply add it as a layer in your actual lambda function.
- Also be wary about macbook vs desktop. The lambda can only run in one architecture, x86 or arm. If you’re building the layer on a DIFF arch than the lambda runtime, it won’t work (psycopg, specifically).
- Other.
- Probably the hardest spelling bee I’ve seen today?
- The village for work. Walked past Charlemagne doing an interview in wsp.
- Instacart hadn’t replied yet, so I submitted the disputes through citi. Wasn’t great over there either. Their interface is finicky – went unavailable multiple times while submitting the 7 disputes. Overall chase and ubereats are significantly better. It’s not close.
- Final day of sinquefield. Fabi wins. Hans wins tournament of peace with 8/9.
- Icloud photos are STILL syncing.
- Supercontest.
- Pinpoint replied (after 2 days) and said they needed (1) company name (2) tollfree phone number. Provided both.
- Lots of work on connecting the new lambdas to various AWS resources.
- Lambda must be in same vpc as rds (and only choose same AZ to avoid cross-AZ charges). Then “connect lambda” on rds side (technically this is just adding the security group, which is the outbound rule lambda->rds over the postgres port).
- Created a test lambda to query RDS. Associated it with my VPC, and only us-west-1a AZ (same as RDS).
- Bunch in the prod app due to the final caching deployment sunday night.
- Harner and I loaded next to each other and he saw my picks on his account. Trying to submit other picks errored with “incorrect CSRF token” exceptions.
- Good. The view was being cached for the
matchups
page! That page is specific to user. I’ll unique-ify it by user later during the react change.
- Removed the view cache for matchups. Checked all other views in the cache, they’re good (not unique by user).
-
- Private work.
- Cuban still gonna run ops, but selling majority stake in mavs for 3.5B, bought in 2000 for 285M. Slightly >10% return per year.
- Sold to Adelson family, casino/gambling empire.
- Kramnik and Hikaru: https://www.chess.com/blog/CHESScom/regarding-recent-accusations
- Convector units serviced in apt.
- AWS is about 1/8th (~80B in 2022) of amazon’s revenue (~470B in 2022). Ecommerce is larger revenue. But AWS is ~75% (~19B in 2022) of total amazon operating profit (~25B of 2022).
- Claude is anthropic’s AI assistant.
- Uploaded photos/videos to icloud to get ~50GB back on device.
- Spotify 2023 wrapped.
Promise.race()
to take a list of promises and return whenever the first promise returns, forwarding along the resolve/reject.
- Side button still defaults to siri for ios. Can disable, but can’t customize to something like powerdown (as it used to).
- Played with bedrock a little bit.
- Connect your own private knowledge bases to help the FM train. Adds relevance/context to your genai app.
- Chat, perform actions, answer questions, search, generate images, summarize notes – APIs for everything.
- re:Invent.
- >50k in vegas, >300k online.
- 12th annual.
- Watched Selipsky’s keynote.
- New: S3 Express One Zone. Up to 10x faster than S3 Standard.
- New: Graviton 4. At least 30% faster than 3.
- Remember nitro’s virtualization is extremely efficient. Abstracts a lot so your available compute is fully allocated to your app.
- Guest: Jensen Huang, ceo/founder nvidia. Basically the new grace hoppers (cpu + gpu) are available to huge infra on aws.
- New: Trainium 2. New chip for ML.
- Guest: Dario Amodei, ceo/cofounder anthropic.
- Titan models are FMs from amazon.
- New: Bedrock Guardrails. Plug in your custom policies for responsible AI.
- Guest: Lidia Fonseca, cto pfizer.
- CodeWhisperer. Autocompletion, explain code, translate, etc. Basically copilot, but less generally-capable, and more tuned to aws.
- New: Amazon Q. AI assistant. Custom trained on all aws services and great for helping design. Respects data privacy, IAM, etc. Will integrate into the IDE soon, making it a nice merge with codewhisperer. The specific feature is called Code Transformation. Example datapoint: internal amazon team successfully upgraded 1000 applications from java 8 to 17 in 2 days.
- Guest: Matt Wood, tech vp aws. Deepdive into Q.
- Guest: Stephan Durach, svp bmw.
- New: Zero-ETL integrations from redshift to (1) aurora postgres (2) rds mysql (3) dynamo (4) opensearch.
- Ended with Kuiper – not sure why in aws keynote, probably cool factor of space. They’re going to not just offer public broadband – they’ll offer private enterprise networks as well.
- Elon and Sorkin discussing twitter, antisemitism, openai, more: https://www.nytimes.com/live/2023/11/29/business/dealbook-summit-news.
- Got spicy at times.
- Larry Page stopped talking to Elon after Elon brought Ilya to OpenAI.
- Still waiting for a reason to be published re Sam’s ousting. But sounds like Elon believes Ilya had good reason (unknown to us).
- NBA fouls.
- Did this before, worth doing again. The lower both numbers, the better (luckier, favorable treatment from refs, etc). Teams do NOT natively commit a substantial difference in fouling – it’s nonzero but not as large as the gaps below.
- 2022-2023 season, GS 29th in fouls (2nd most whistles blown against them) and GS 28th in opponent fouls (3rd least whistles blown against the opponent). For comparison (since they played last night): Kings 12th and 3rd.
- 2023-2024 season, GS 28th in fouls (3rd most whistles blown against them) and GS 14th in opponent fouls (avg number of whistles blown against the opponent). For comparison (since they played last night): Kings 24th and 8th.
- Supercontest.
- Checked the cache for a view key – yep, the value is just the rendered HTML (css and js still served from flask/gunicorn).
- Looks like the cache is max ~10MB (when everything is not expired)
redis-cli info memory
.
- Elasticache serverless pricing.
- Storage: $0.139 / GB-hour, and I have .01GB = $1/mo.
- Requests: $0.0038 / million ECPUs, where an ECPU is basically 1KB of data read or written, and say I have 10 reads/writes every minute, each 100KB -> 1000 ECPUs/min -> $0.16.
- That would all be well and dandy, but the MINIMUM meter for a cache is 1GB. So my 10M cache doesn’t get the cost savings. With the minimum, storage becomes $100/mo. And requests are trivial after that.
- So no – probably not worth the price yet.
- Spreads.
- Should probably go back through and replace all “line” with “spread” – more common. Handicap is also used.
- This site shows (static) lines across multiple books: https://www.wagertalk.com/odds?sport=L1&type=1&date=2023-11-26&cb=0.6602684239755252
- The second number after spreads is (I believe) the moneyline for that spread. Usually around -110 for both teams to cover. Very close to 50/50, as spreads are designed to achieve. The lower the number, the more likely.
- SQS.
- Spent most of the day migrating the score fetch/commit to sqs/lambda/eventbridge.
- Punted the upgrade of picks to the same event/queue, once the pick interface is in react: https://gitlab.com/bmahlstedt/supercontest/-/issues/232.
- Created the FIFO queue,
supercontest-scores
.
- Created the 2 new lambdas, the fetcher (reads from api, writes to queue) and the committer (reads from queue, writes to db).
- In this process, plugged a few things in:
- Auth: Lambda <-> SQS
- Auth: Lambda <-> RDS
- Trigger: EventBridge <-> Lambda
- Trigger: SQS <-> Lambda
- Boto3 in the lambda function to write to sqs, simple.
- Remember you have to pass MessageGroupID with FIFO queues. It’s for logical separation, guaranteeing only-once within single msg groups.
- Sent the same msg a few times from lambda test. SQS properly deduplicated (there was only one message in the queue). But there’s a piece of metadata on the msg called
receive_count
which ticks up for every duplication.
- Remember that a HUGE benefit of queues is the abstraction of producers and consumers. If you have one trigger and one response, one writer and one reader – a queue loses much of its value. Just directly plug the 2 services.
- It’s still nice to atomize the various pieces, and queues make you think about the producer/consumer split still.
- Submitted picks.
-
- Private work.
- Reddit looking to IPO as early as next quarter. No live deals on EZ. Don’t think I’d want to anyway – they lost a lot with the API monetization / apollo / etc.
- Got christmas tree! Only $250 for a 7′ in manhattan.
- Updated butcherbox items, changed bill date.
- Amazon buying iRobot (roombas) for 1.7B.
- Lots of mealprep, coffee, hibiscus brew, liver, powders, oat milk, more.
- Remember for general AWS support (even if you don’t have a support plan, which technically means you can’t get support) – create a general case, then “contact us” (instead of “solve now”), then chat with representative. It will file under General Question – Account.
- The cheapest is the dev support plan, which starts at $29/mo.
- Got Eddie’s registry gift.
- Submitted the instacart fraud form. If they don’t resolve by thursday, I’ll dispute with citi.
- Drycleaned the goat off my peacoat.
- Chatgpt and copilot both throttled quite a bit. Inaccessible for large-ish periods of time.
- Garden maintenance.
- AWS re:Invent.
- Can watch live on https://reinvent.awsevents.com, or stream after on their youtube channel
aws events
https://www.youtube.com/playlist?list=PL2yQDdvlhXf-5R7VtNr9P4nosA7DiDtM1.
- Actual looks like they’ll post everything: separate playlists for keynotes, innovation talks, and breakout sessions.
- Watched Desantis’ monday night.
- Grover is the system behind aurora. All db logs get written to grover.
- Nitro is the hypervisor behind aurora serverless? Caspian is related.
- New: limitless db. In aurora. Single endpoint, it will handle all the sharding behind the scenes.
- New: serverless elasticache! Uses all the backend infra that aurora does.
- ML-powered query resource prediction in redshift.
- 6x better error correction in quantum computing chips.
- Updated docker desktop 4.25.2.
- Updated ios 16.6.1 -> 17.1.1.
- Facetime voicemails (video!)
- NameDrop.
- Next imessage interface, better layout for text vs all attachments (gifs, photos, whatever).
- AWS cost optimization.
- Played with Cost Optimization Hub and Computer Optimizer.
- Shows if you’re underprovisioned, overprovisioned, or rightsized. Covers compute, storage, mem, everything. Mostly EC2, ECS, lambda, and EBS.
- Makes suggestions for reservations to reduce costs. Shows utilization of RIs, etc.
- Supercontest.
- I didn’t really migrate to AWS until Oct 22, basically for the 2022-2023 season. And then it was only EC2 and some light peripherals. And then the full atomization/migration started in July 23 (to present).
- Created aws support case for the pinpoint bullshit: https://support.console.aws.amazon.com/support/home?region=us-east-1#/case/?displayId=170118848901975&language=en.
- General servicedesk forwarded it onto the pinpoint team with urgency.
- Vegas.
- Updated banner.
- Quick note on elasticache: I chose this over dynamodb for perf. Redis is just faster. Don’t need querying capability or peripheral features.
-
- Private work.
- Back to nyc.
- JS notes in gdoc.
- Link another credit card save/connect tool.
- Naiad, canid, canna, dacha.
- Linkedin premium is ~$30/mo (individual).
- Leetcode premium is ~$11/mo (annual sub, cyber monday deal). Dynamic layout, autocompletion, debugger, access to premium problems, access to some editorials, faster execution.
React.memo
.
- Supercontest.
- AWS Billing and Cost Management.
- Enabled cost optimization suggestions. Creates a role to access your other services, collects usage, gives realtime updates.
- Opted into and played with Compute Optimizer.
- Created a cost monitor and attached subscription (my email). Sends daily summaries and alerts if >50% above expected (a single day, I believe).
- Created 4 budgets: 1 for monthly spend under a certain amount (actual AND projected), and 3 for each RI ensuring that utilization of the RI is 100%. All 4 email me if triggered.
- VSCode SSH Remote.
- Installed all extensions in the sbsc remote. Remember this is an installation on the remote.
- It bricked the EC2 instance. Not sure which extension. Maybe one of the windows-specific ones?
- Rebooted from EC2, connected, removed all vscode extensions (kept them local, uninstalled from ssh:sbsc).
- Remember the disconnections could have been from my poor internet too. Just wait a few.
- Remember you can
make build-start-prod
without losing any data, even if you restart or stop-prod
manually, and that’s how it’s always been. BUT it USED to be the case that make down-prod
would wipe the DB volume. Now that’s clean too – it persists in RDB, regardless if prod docker composition (just app+nginx) is downed.
- ElastiCache.
- Went through the app and added some view function
cached
and regular function memoize
decorators.
- Played with an initial memoization from flask-cli. Nothing was persisting. Ah – it’s because CLI uses NullCache. Changes so the prod flask cli connects to the prod elasticache (like it already does with rds).
- Note: you cannot traverse sqla relationships from a cached object. The parent obj is not bound to a session, the dependents are dangling.
- You can change this to subquery or selectin loading (rather than the default lazy, which queries at ACCESS time)(https://docs.sqlalchemy.org/en/20/orm/queryguide/relationships.html) or manually load all children on the dangling object with new queries, but then we defeat the whole purpose of a cache.
- Memoized most of the functions in
queries
(as long as they return something, and something other than direct sqla objects). This should speed up some stuff like get_current_week()
, is_regseason()
, etc. TTL set to 30, since the intention for the memoization is intra-request optimization, not inter. Will do that with view caching next.
- Also – you don’t really want to cache anything outside of query libs. I have lots of functionality in utils and other libs. But the point of the cache is to optimally save a db trip. If the other logic is a local compute op, up to a reasonable ceiling of time complexity, it’s faster than network-hitting redis anyway.
- Added caching for the main view functions. Set TTL to 60 to match the frequency of the score fetch, the primary cache invalidator.
- Skipped caching for API endpoints, stuff like
/email-all-picks
and /commit-scores
.
- Created followup ticket for event-driven cache invalidation (based on
supercontest.dbsession.commits
), rather than blanket time-driven TTLs right now.
- Deployed to prod, tested, ready for MNF.
- Created a new cost report for Amortized blending (takes the RIs and extends their costs in the daily/usage expenses). And then filtered RIs out of the main cost report for daily service totals.
- Added paid users, now to 20. Expect 27 total.
- There was an infinite recursion in the function that adjusts purses for ties. This occurred when there were only 4 people in the paid league. Not sure which ranks were tied.
- Will debug this next time I see it.
- Enabled some aws cost mgmt prefs: multi-year lookback at monthly granularity (up to 38mo), daily granularity for all services up to 14 day lookback (from 7, default).
-
- Private work.
- Some more refreshers on (pandas, psql, dsa, js). Remember postincrement
i++
(eval to val then increment) and preincrement ++i
(increment then eval to val). And ==
vs ===
for strict type. Error. new.
- AWS merge Billing with Cost Explorer -> Billing and Cost Management.
- In redis, just
EXPIRE <mykey> <ttl>
. You can check with TTL <mykey>
. Then flask-caching
obviously allows you to plug into the redis api.
- Supercontest. Found a bug in the parsing of the espn score API. Added to the ticket where I’m swapping those out.
-
- Private work.
- Gitlab-runner runs on macbook even when vscode is closed; it’s running the container whenever the host is up. Remember it directly runs – not through a ubuntu container on wsl2 for my desktop.
- Christmas shopping. Went through amazon (+other) black friday and cyber monday.
- No-rush shipping options gets 6% back an prime visa (vs 5).
- Played with mint a little. Remember moving to credit karma. Will fix solium connection etc at that time.
- Increased credit limits.
- Money moves.
- AWS is paid by CSR. Remember auto/condo insurance are on doublecash.
- There was an errant instacart+ subscription being charged to my citi card (my actual account is the chase one) since May.
- Reached out to instacart help. Was transferred over 15 times lol. Syed A, Neelima P, Bishal D, Anthony M, Carol V, Tabrez P, Sumera S, Swetha S, Neelima P again, Amanda D, Khanyisile M. At this point, they turned off the notifications.
- Then the fraud team just said “fill out this unrecognized-charges form and we’ll get back to you in 7-10 days” – unacceptable. https://www.instacart.com/secure_forms/unrecognized_charges.
- Didn’t fill it out, instacart didn’t deserve the courtesy. Went to cc to dispute.
- Citi’s dispute interface was “temporarily unavailable” and I couldn’t submit. Both great systems! Gonna cancel both citi and instacart after this trash.
- Amazon reload $100, get 10% back, once.
-
- Private work.
- Remember gnumake’s variables are accessed with
$(var)
. To grab shell variables, use $$var
.
- So you don’t have to set upstream on every new git branch:
git config --global --add --bool push.autoSetupRemote true
- Redis $5.62 on equitybee.
- Added gitlab runners to my macbook so I can pass CICD while working remotely.
/srv
doesn’t exist by default, so sudo mkdir /private/srv
and chown it to you then run the usual two commands:
docker run -d --name gitlab-runner --restart always -v /private/srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
docker exec -it gitlab-runner gitlab-runner register
- Then enter all the info. Token is from the “create new runner” screen on gitlab’s UI. Default image usually
python:3.12
. Executor type is docker.
- Then just up the concurrency by editing
/private/srv/gitlab-runner/config/config.toml
on the host.
- Pandas
group_by
, agg
, more.
- Supercontest.
- Fixed the auth for redis-cli and the private conf file. It’s still clunky (sourcing secret then passing var). Redis-cli should absolutely provide native support for reading auth from a file.