SlideShare a Scribd company logo
1 of 40
Download to read offline
Adopting Go modules in NATS v2
Gopherpalooza / November 2019
Waldemar Quevedo / @wallyqs
💦
🔥
@wallyqs
#Gopherpalooza
Heads up: A few Game Of Thrones
spoilers in this talk… 👀
@wallyqs
#Gopherpalooza
● Waldemar Quevedo / @wallyqs
● Software Engineer at Synadia Communications, Inc
● NATS core maintainer (Ruby, Python, Go, K8S)
● Author of Practical NATS (Apress, 2018)
About me
@wallyqs
#Gopherpalooza
What is NATS?
@wallyqs
#Gopherpalooza
NATS is a simple,
production proven,
cloud-native
messaging system.
@wallyqs
#Gopherpalooza
NATS Intro
● Created by Derek Collison in 2010 for CloudFoundry
● DNA: Simplicity, performance, security, and availability
● TCP/IP based with a very simple plain text protocol
| PUB | SUB | UNSUB | CONNECT | INFO | MSG | -ERR | +OK | PING | PONG |
@wallyqs
#Gopherpalooza
Next year: #NATSTurns10
@wallyqs
#Gopherpalooza
CNCF Landscape
Joined CNCF as an
incubation project
in 2018
https://landscape.cncf.io
@wallyqs
#Gopherpalooza
CNCF Landscape
Joined CNCF as an
incubation project
in 2018
https://landscape.cncf.io
@wallyqs
#Gopherpalooza
CNCF Landscape
@wallyqs
#Gopherpalooza
In May 2019, the NATS team was
ready to ship the biggest release
of the server so far...
@wallyqs
#Gopherpalooza
NATS v2 spike
A lot of development happened in 2018
@wallyqs
#Gopherpalooza
Meanwhile...
@wallyqs
#Gopherpalooza
Modules made it into Go 1.11
● Solution for dependencies so far used by NATS projects
was vendoring with `gvt` but got retired
● Team was still on the fence of whether to use `dep`
@wallyqs
#Gopherpalooza
dep?
I am not sure what you are now
@wallyqs
#Gopherpalooza
dep?
That’s not important
@wallyqs
#Gopherpalooza
OK, using Go Modules 😬
@wallyqs
#Gopherpalooza
Original plan for NATS v2 release
● Adopt Go Modules to get a reproducible build
● Rename the server repos:
○ From: github.com/nats-io/gnatsd
○ To: github.com/nats-io/nats-server
● Rename the client repos:
○ From: github.com/nats-io/go-nats
○ To: github.com/nats-io/nats.go
● Bump client and server version to v2 (git tag)
@wallyqs
#Gopherpalooza
Adopting Go modules
⚠
● Simple enough
@wallyqs
#Gopherpalooza
Original plan for NATS v2 release
● Adopt Go Modules to get a reproducible build
● Rename the server repos:
○ From: github.com/nats-io/gnatsd
○ To: github.com/nats-io/nats-server
● Rename the client repos:
○ From: github.com/nats-io/go-nats
○ To: github.com/nats-io/nats.go
● Bump client and server version to v2 (git tag)
✅
@wallyqs
#Gopherpalooza
NATS repo has changed often
● Past names of NATS repo:
github.com/apcera/nats
github.com/nats-io/nats
github.com/nats-io/go-nats
github.com/nats-io/nats.go (← current)
@wallyqs
#Gopherpalooza
Original plan for NATS v2 release
● Adopt Go Modules to get a reproducible build
● Rename the server repos:
○ From: github.com/nats-io/gnatsd
○ To: github.com/nats-io/nats-server
● Rename the client repos:
○ From: github.com/nats-io/go-nats
○ To: github.com/nats-io/nats.go
● Bump client and server version to v2 (git tag)
✅
✅
@wallyqs
#Gopherpalooza
Here be dragons… 🐉
@wallyqs
#Gopherpalooza
🔥🔥🔥
Lots of broken projects!!!
“No such file?”
Same dependency twice
using different names??
@wallyqs
#Gopherpalooza
Time to rollback (what we can…)
@wallyqs
#Gopherpalooza
Only v2 tag in the server
● Changing both client and server to v2 series turned out too
big of a change for the ecosystem 🤯
Missed this!
@wallyqs
#Gopherpalooza
Couldn’t rollback name change
● Already out there so created read-only versions of the old
name pre modules
@wallyqs
#Gopherpalooza
`go get` fetching v1 by default
@wallyqs
#Gopherpalooza
More `go get` issues
@wallyqs
#Gopherpalooza
`go get` issues with dots in names
https://github.com/golang/go/issues/32483
@wallyqs
#Gopherpalooza
Got worse in Go 1.13
https://github.com/golang/go/issues/32483
@wallyqs
#Gopherpalooza
Fixed in Go1.13.3 by @jayconrod
https://github.com/golang/go/issues/32483
@wallyqs
#Gopherpalooza
Dot in names now ok to use
Trailing slash
workaround also
supported for
now
@wallyqs
#Gopherpalooza
What we should have done...
@wallyqs
#Gopherpalooza
What we should have done
● Carefully read the wiki entry about modules (60 pages!)
https://github.com/golang/go/wiki/Modules
● Thankfully more guides are appearing now:
https://blog.golang.org/v2-go-modules
@wallyqs
#Gopherpalooza
What we should have done
● Renaming a Go project is extremely difficult
https://github.com/golang/go/wiki/Resolving-Problems-
From-Modified-Module-Path
@wallyqs
#Gopherpalooza
What we should have done
● Before adopting modules, definitely join #modules
channel in Gophers slack and look at recent issues
@wallyqs
#Gopherpalooza
What we should have done
● Make a careful plan, Kubernetes good example:
https://github.com/kubernetes/enhancements/blob/master/keps/sig-arch
itecture/2019-03-19-go-modules.md
@wallyqs
#Gopherpalooza
Questions?
@wallyqs
#Gopherpalooza
https://natsio.slack.com
Ping us in Slack if have issues with NATS
and/or Go modules 🙏

More Related Content

More from wallyqs

GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...wallyqs
 
GopherFest 2017 - Adding Context to NATS
GopherFest 2017 -  Adding Context to NATSGopherFest 2017 -  Adding Context to NATS
GopherFest 2017 - Adding Context to NATSwallyqs
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016wallyqs
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)wallyqs
 
RustなNATSのClientを作ってみた
RustなNATSのClientを作ってみたRustなNATSのClientを作ってみた
RustなNATSのClientを作ってみたwallyqs
 
サルでもわかるMesos schedulerの作り方
サルでもわかるMesos schedulerの作り方サルでもわかるMesos schedulerの作り方
サルでもわかるMesos schedulerの作り方wallyqs
 

More from wallyqs (6)

GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...GopherCon 2017 -  Writing Networking Clients in Go: The Design & Implementati...
GopherCon 2017 - Writing Networking Clients in Go: The Design & Implementati...
 
GopherFest 2017 - Adding Context to NATS
GopherFest 2017 -  Adding Context to NATSGopherFest 2017 -  Adding Context to NATS
GopherFest 2017 - Adding Context to NATS
 
NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016NATS + Docker meetup talk Oct - 2016
NATS + Docker meetup talk Oct - 2016
 
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)The Zen of High Performance Messaging with NATS (Strange Loop 2016)
The Zen of High Performance Messaging with NATS (Strange Loop 2016)
 
RustなNATSのClientを作ってみた
RustなNATSのClientを作ってみたRustなNATSのClientを作ってみた
RustなNATSのClientを作ってみた
 
サルでもわかるMesos schedulerの作り方
サルでもわかるMesos schedulerの作り方サルでもわかるMesos schedulerの作り方
サルでもわかるMesos schedulerの作り方
 

Recently uploaded

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Gopherpalooza 2019 - Adopting Go Modules in NATS v2