SlideShare a Scribd company logo
1 of 29
Download to read offline
© 2021 - The @ Company | atsign.dev
Dart on Arm
Flutter Bangalore Meetup - June 2021
© 2021 - The @ Company | atsign.dev
2
A brief introduction
Engineer, The @ Company,
building a platform that puts people in
control of their data.
Co-host, Tech Debt Burndown Podcast
Cloud Editor, InfoQ
Links to socials etc. at chris.swanz.net
© 2021 - The @ Company | atsign.dev
3
Agenda
➔ Start with WHY - why Arm is important
◆ ‘Full Stack Dart’ to complement Flutter Apps
◆ Arm growth in the cloud and IoT
➔ Just In Time (JIT) vs Ahead of Time (AOT) - the trade offs
➔ Dependencies for building and running AOT binaries
➔ All a bit x86 - how do I get Arm?
➔ Cross platform building made easy
➔ Q & A
Full Stack Dart
https://events.google.com/io/session/6d5795f2-ec1c-4c7a-9efa-ea90c8c59c03?lng=en
https://events.google.com/io/session/083b441e-4076-4443-9750-6529b34257b7?lng=en
https://gcppodcast.com/post/episode-261-full-stack-dart-with-tony-pujals-and-kevin-moore/
Arm growth is huge
in the cloud and IoT
© 2021 - The @ Company | atsign.dev
10
We want to give people options on where their stuff is
JIT vs AOT
Dartshowplatform - A more useful ‘Hello World!’
import 'dart:io' show Platform, stdout;
void main() {
print(Platform.version);
}
2.13.1 (stable) (Fri May 21 12:45:36
2021 +0200) on "linux_arm64"
JIT - Just `dart run` it in the virtual machine
$ time dart run showplatform.dart
2.13.1 (stable) (Fri May 21 12:45:36
2021 +0200) on "linux_arm64"
real 0m4.728s
user 0m4.903s
sys 0m0.684s
AOT - Compile it first then run the binary
$ dart compile exe showplatform.dart
$ time ./showplatform.exe
2.13.1 (stable) (Fri May 21 12:45:36
2021 +0200) on "linux_arm64"
real 0m0.023s
user 0m0.008s
sys 0m0.015s
Trade off - compilation is slow
$ time dart compile exe showplatform.dart
Info: Compiling with sound null safety
Generated: showplatform.exe
real 0m17.434s
user 0m20.912s
sys 0m2.958s
Dependencies for building
and running an AOT binary
Dockerfile for dartshowplatform
FROM dart AS build
WORKDIR /app
COPY ./showplatform.dart .
RUN dart compile exe showplatform.dart 
-o dartshowplatform
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/dartshowplatform 
/app/dartshowplatform
ENTRYPOINT ["/app/dartshowplatform"]
Inside the Dockerfile for dart - what’s in /runtime
RUN set -eux; 
for f in 
/etc/nsswitch.conf 
/etc/ssl/certs 
/lib/x86_64-linux-gnu/libc.so.6 
/lib/x86_64-linux-gnu/libdl.so.2 
/lib/x86_64-linux-gnu/libm.so.6 
/lib/x86_64-linux-gnu/libnss_dns.so.2 
/lib/x86_64-linux-gnu/libpthread.so.0 
/lib/x86_64-linux-gnu/libresolv.so.2 
/lib/x86_64-linux-gnu/librt.so.1 
/lib64/ld-linux-x86-64.so.2 
/usr/share/ca-certificates 
; do 
dir="$(dirname "$f")"; 
mkdir -p "/runtime$dir"; 
cp --archive --link --dereference --no-target-directory "$f" "/runtime$f"; 
done
All a bit x86 - how do I get Arm?
atsigncompany/buildimage Dockerfile - arch specific
case "$(uname -m)" in 
armv7l | armv7) ARCH="arm-linux-gnueabihf" ; 
mkdir -p /runtime/lib/"$ARCH" ; 
cp /lib/ld-linux-armhf.so.3 /runtime/lib/ld-linux-armhf.so.3 ; 
cp /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 
/runtime/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ;; 
aarch64) ARCH="aarch64-linux-gnu" ; 
mkdir -p /runtime/lib/"$ARCH" ; 
cp /lib/ld-linux-aarch64.so.1 /runtime/lib/ld-linux-aarch64.so.1 ; 
cp /lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 
/runtime/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 ;; 
*) ARCH="x86_64-linux-gnu" ; 
mkdir -p /runtime/lib64/ ; 
cp /lib64/ld-linux-x86-64.so.2 /runtime/lib64/ld-linux-x86-64.so.2 ;; 
esac &&
atsigncompany/buildimage Dockerfile - arch generic
for f in 
/etc/nsswitch.conf 
/etc/ssl/certs 
/lib/"$ARCH"/libc.so.6 
/lib/"$ARCH"/libdl.so.2 
/lib/"$ARCH"/libm.so.6 
/lib/"$ARCH"/libnss_dns.so.2 
/lib/"$ARCH"/libpthread.so.0 
/lib/"$ARCH"/libresolv.so.2 
/lib/"$ARCH"/librt.so.1 
/usr/share/ca-certificates 
; do 
dir="$(dirname "$f")"; 
mkdir -p "/runtime$dir"; 
cp --archive --link --dereference --no-target-directory "$f" "/runtime$f"; 
done;
Cross platform building made easy
Dockerfile for dartshowplatform
FROM atsigncompany/buildimage AS build
WORKDIR /app
COPY ./showplatform.dart .
RUN dart compile exe showplatform.dart 
-o dartshowplatform
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/dartshowplatform 
/app/dartshowplatform
ENTRYPOINT ["/app/dartshowplatform"]
GitHub Action snippet
name: Build and push
id: docker_build
uses: docker/build-push-action@v2.5.0
with:
file: ./dartshowplatform/Dockerfile
push: true
tags: |
atsigncompany/dartshowplatform:automated
atsigncompany/dartshowplatform:latest
atsigncompany/dartshowplatform:GHA${{ github.run_number }}
platforms: |
linux/amd64
linux/arm64/v8
The end results
https://github.com/atsign-company/at_dockerfiles
© 2021 - The @ Company | atsign.dev
26
Recap
➔ Arm is important
◆ ‘Full Stack Dart’ to complement Flutter Apps
◆ Arm growth in the cloud and IoT
➔ Just In Time (JIT) vs Ahead of Time (AOT) - the trade offs
➔ Dependencies for building and running AOT binaries
➔ All a bit x86 - how do I get Arm?
➔ Cross platform building made easy
➔ Q & A
Questions?
27
Contacts
Chris Swan
chris@atsign.com
@cpswan
Anthony Prakash
Developer Relations
anthony@atsign.com
@anthony
At The @ Company (The At Company) we are technologists, creators, and
builders with one thing in common: We love the Internet. You could go so far as
to call us Internet optimists. Though we acknowledge that the Internet has deep
flaws, we believe that we can extract all its goodness without sacrificing our
privacy, time, and control over our digital identities.
We’ve committed ourselves to the creation of a more human Internet where
privacy is a fundamental right and everyone owns their own data. Let’s say
goodbye to the fear and paranoia caused by data breaches and unsolicited
online surveillance.
We’ve developed a fully-secure, privacy-compliant technology powering
customer mobile applications: the @protocol, and with unique identifiers called
@signs that act as keys into these experiences. With like-minded partners we’re
resolving these long-standing issues with a spirit of fun, not fear, and with
delightful customer experiences.
FACT SHEET
Founded : 2019, by Barbara
Tallent, Colin Constable, and Kevin
Nickels, 30+ years executive
experience at NCD/Netmanage,
Credit Suisse, Deutsche Bank,
Juniper Networks, Founded 3 prior
startups, 3 exits. Chairman: Kim
Perdikou, PCNET, Reader’s Digest,
most recently CIO, GM, EVP Juniper
Networks
HQ : Virtual offices, with base in
San Jose, CA.
Funding : $11M seed, May, 2021
Employees: 22
Patents : 15 pending
Website : https://atsign.com

More Related Content

Similar to Dart on Arm - Flutter Bangalore June 2021

Similar to Dart on Arm - Flutter Bangalore June 2021 (20)

Flutter Festival London 2022 - End to end IoT with Dart and Flutter
Flutter Festival London 2022 - End to end IoT with Dart and FlutterFlutter Festival London 2022 - End to end IoT with Dart and Flutter
Flutter Festival London 2022 - End to end IoT with Dart and Flutter
 
Flutter Vikings 2022 - End to end IoT with Dart and Flutter
Flutter Vikings 2022 - End to end IoT with Dart and FlutterFlutter Vikings 2022 - End to end IoT with Dart and Flutter
Flutter Vikings 2022 - End to end IoT with Dart and Flutter
 
Enterprise serverless
Enterprise serverlessEnterprise serverless
Enterprise serverless
 
Flutter Vikings 2022 - Full Stack Dart
Flutter Vikings 2022  - Full Stack DartFlutter Vikings 2022  - Full Stack Dart
Flutter Vikings 2022 - Full Stack Dart
 
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
Connectivity is here (5 g, swarm,...). now, let's build interplanetary apps! (1)
 
QConSF 2022 - Backends in Dart
QConSF 2022 - Backends in DartQConSF 2022 - Backends in Dart
QConSF 2022 - Backends in Dart
 
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
Spring Boot & Spring Cloud on PAS- Nate Schutta (1/2)
 
Open stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshareOpen stack gbp final sn-4-slideshare
Open stack gbp final sn-4-slideshare
 
IRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOCIRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOC
 
DevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDKDevCon5 (July 2014) - Acision SDK
DevCon5 (July 2014) - Acision SDK
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Chaos Engineering for PCF
Chaos Engineering for PCFChaos Engineering for PCF
Chaos Engineering for PCF
 
ONLINE FOOD ORDERS THROUGH WHATSAPP AUTOMATION BOT
ONLINE FOOD ORDERS THROUGH WHATSAPP AUTOMATION BOTONLINE FOOD ORDERS THROUGH WHATSAPP AUTOMATION BOT
ONLINE FOOD ORDERS THROUGH WHATSAPP AUTOMATION BOT
 
【BS1】What’s new in visual studio 2022 and c# 10
【BS1】What’s new in visual studio 2022 and c# 10【BS1】What’s new in visual studio 2022 and c# 10
【BS1】What’s new in visual studio 2022 and c# 10
 
Rtp bluemix meetup june 2016 anki and node red
Rtp bluemix meetup june 2016 anki and node redRtp bluemix meetup june 2016 anki and node red
Rtp bluemix meetup june 2016 anki and node red
 
Using Data Science & Serverless Python to find apartment in Toronto
Using Data Science & Serverless Python to find apartment in TorontoUsing Data Science & Serverless Python to find apartment in Toronto
Using Data Science & Serverless Python to find apartment in Toronto
 
IoT Standardisation Panel
IoT Standardisation PanelIoT Standardisation Panel
IoT Standardisation Panel
 
IoT standardisation
IoT standardisationIoT standardisation
IoT standardisation
 
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
Haufe Onboarding - Fast Iterating With the MERN Stack - TEC Day 2019
 
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
The Enterprise wants WebRTC -- and it needs Middleware to get it! (IIT RTC Co...
 

More from Chris Swan

More from Chris Swan (20)

LNETM - Atsign - Privacy with Personal Data Services
LNETM - Atsign - Privacy with Personal Data ServicesLNETM - Atsign - Privacy with Personal Data Services
LNETM - Atsign - Privacy with Personal Data Services
 
SOOCon24 - Showing that you care about security - OpenSSF Scorecards
SOOCon24 - Showing that you care about security - OpenSSF ScorecardsSOOCon24 - Showing that you care about security - OpenSSF Scorecards
SOOCon24 - Showing that you care about security - OpenSSF Scorecards
 
All Day DevOps 2023 - Implementing OSSF Scorecards Across an Organisation.pdf
All Day DevOps 2023 - Implementing OSSF Scorecards Across an Organisation.pdfAll Day DevOps 2023 - Implementing OSSF Scorecards Across an Organisation.pdf
All Day DevOps 2023 - Implementing OSSF Scorecards Across an Organisation.pdf
 
Fluttercon Berlin 23 - Dart & Flutter on RISC-V
Fluttercon Berlin 23 - Dart & Flutter on RISC-VFluttercon Berlin 23 - Dart & Flutter on RISC-V
Fluttercon Berlin 23 - Dart & Flutter on RISC-V
 
QConNY 2023 - Implementing OSSF Scorecards Across an Organisation
QConNY 2023 - Implementing OSSF Scorecards Across an OrganisationQConNY 2023 - Implementing OSSF Scorecards Across an Organisation
QConNY 2023 - Implementing OSSF Scorecards Across an Organisation
 
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and FlutterFlutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
Flutter SV Meetup Oct 2022 - End to end encrypted IoT with Dart and Flutter
 
London IoT Meetup Sep 2022 - End to end encrypted IoT
London IoT Meetup Sep 2022 - End to end encrypted IoTLondon IoT Meetup Sep 2022 - End to end encrypted IoT
London IoT Meetup Sep 2022 - End to end encrypted IoT
 
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
EMFcamp2022 - What if apps logged into you, instead of you logging into apps?
 
Devoxx UK 2022 - Application security: What should the attack landscape look ...
Devoxx UK 2022 - Application security: What should the attack landscape look ...Devoxx UK 2022 - Application security: What should the attack landscape look ...
Devoxx UK 2022 - Application security: What should the attack landscape look ...
 
Keeping a project going
Keeping a project goingKeeping a project going
Keeping a project going
 
TMS9995 on RC2014
TMS9995 on RC2014TMS9995 on RC2014
TMS9995 on RC2014
 
CloudCamp London Nov 2019 Intro
CloudCamp London Nov 2019 IntroCloudCamp London Nov 2019 Intro
CloudCamp London Nov 2019 Intro
 
DevSecOps Days London - Teaching 'Shift Left on Security'
DevSecOps Days London - Teaching 'Shift Left on Security'DevSecOps Days London - Teaching 'Shift Left on Security'
DevSecOps Days London - Teaching 'Shift Left on Security'
 
Cooking with a touch of science and a dash of engineering
Cooking with a touch of science and a dash of engineeringCooking with a touch of science and a dash of engineering
Cooking with a touch of science and a dash of engineering
 
Agile Enterprise Rome 2018 - Ops and Security in a PaaS and Serverless world
Agile Enterprise Rome 2018 - Ops and Security in a PaaS and Serverless worldAgile Enterprise Rome 2018 - Ops and Security in a PaaS and Serverless world
Agile Enterprise Rome 2018 - Ops and Security in a PaaS and Serverless world
 
The Marginal Cost of Making Mistakes
The Marginal Cost of Making MistakesThe Marginal Cost of Making Mistakes
The Marginal Cost of Making Mistakes
 
CloudCamp London 8 Mar 2018 - Douglas Adams
CloudCamp London 8 Mar 2018 - Douglas AdamsCloudCamp London 8 Mar 2018 - Douglas Adams
CloudCamp London 8 Mar 2018 - Douglas Adams
 
Jeffconf 2017 LessOps
Jeffconf 2017 LessOpsJeffconf 2017 LessOps
Jeffconf 2017 LessOps
 
"Our problems are easy"
"Our problems are easy""Our problems are easy"
"Our problems are easy"
 
Progscon 2017 Operation Considerations for Containers
Progscon 2017 Operation Considerations for ContainersProgscon 2017 Operation Considerations for Containers
Progscon 2017 Operation Considerations for Containers
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Dart on Arm - Flutter Bangalore June 2021

  • 1. © 2021 - The @ Company | atsign.dev Dart on Arm Flutter Bangalore Meetup - June 2021
  • 2. © 2021 - The @ Company | atsign.dev 2 A brief introduction Engineer, The @ Company, building a platform that puts people in control of their data. Co-host, Tech Debt Burndown Podcast Cloud Editor, InfoQ Links to socials etc. at chris.swanz.net
  • 3. © 2021 - The @ Company | atsign.dev 3 Agenda ➔ Start with WHY - why Arm is important ◆ ‘Full Stack Dart’ to complement Flutter Apps ◆ Arm growth in the cloud and IoT ➔ Just In Time (JIT) vs Ahead of Time (AOT) - the trade offs ➔ Dependencies for building and running AOT binaries ➔ All a bit x86 - how do I get Arm? ➔ Cross platform building made easy ➔ Q & A
  • 7. Arm growth is huge in the cloud and IoT
  • 8.
  • 9.
  • 10. © 2021 - The @ Company | atsign.dev 10 We want to give people options on where their stuff is
  • 12. Dartshowplatform - A more useful ‘Hello World!’ import 'dart:io' show Platform, stdout; void main() { print(Platform.version); } 2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "linux_arm64"
  • 13. JIT - Just `dart run` it in the virtual machine $ time dart run showplatform.dart 2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "linux_arm64" real 0m4.728s user 0m4.903s sys 0m0.684s
  • 14. AOT - Compile it first then run the binary $ dart compile exe showplatform.dart $ time ./showplatform.exe 2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "linux_arm64" real 0m0.023s user 0m0.008s sys 0m0.015s
  • 15. Trade off - compilation is slow $ time dart compile exe showplatform.dart Info: Compiling with sound null safety Generated: showplatform.exe real 0m17.434s user 0m20.912s sys 0m2.958s
  • 16. Dependencies for building and running an AOT binary
  • 17. Dockerfile for dartshowplatform FROM dart AS build WORKDIR /app COPY ./showplatform.dart . RUN dart compile exe showplatform.dart -o dartshowplatform FROM scratch COPY --from=build /runtime/ / COPY --from=build /app/dartshowplatform /app/dartshowplatform ENTRYPOINT ["/app/dartshowplatform"]
  • 18. Inside the Dockerfile for dart - what’s in /runtime RUN set -eux; for f in /etc/nsswitch.conf /etc/ssl/certs /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/libnss_dns.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libresolv.so.2 /lib/x86_64-linux-gnu/librt.so.1 /lib64/ld-linux-x86-64.so.2 /usr/share/ca-certificates ; do dir="$(dirname "$f")"; mkdir -p "/runtime$dir"; cp --archive --link --dereference --no-target-directory "$f" "/runtime$f"; done
  • 19. All a bit x86 - how do I get Arm?
  • 20. atsigncompany/buildimage Dockerfile - arch specific case "$(uname -m)" in armv7l | armv7) ARCH="arm-linux-gnueabihf" ; mkdir -p /runtime/lib/"$ARCH" ; cp /lib/ld-linux-armhf.so.3 /runtime/lib/ld-linux-armhf.so.3 ; cp /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /runtime/lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ;; aarch64) ARCH="aarch64-linux-gnu" ; mkdir -p /runtime/lib/"$ARCH" ; cp /lib/ld-linux-aarch64.so.1 /runtime/lib/ld-linux-aarch64.so.1 ; cp /lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 /runtime/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 ;; *) ARCH="x86_64-linux-gnu" ; mkdir -p /runtime/lib64/ ; cp /lib64/ld-linux-x86-64.so.2 /runtime/lib64/ld-linux-x86-64.so.2 ;; esac &&
  • 21. atsigncompany/buildimage Dockerfile - arch generic for f in /etc/nsswitch.conf /etc/ssl/certs /lib/"$ARCH"/libc.so.6 /lib/"$ARCH"/libdl.so.2 /lib/"$ARCH"/libm.so.6 /lib/"$ARCH"/libnss_dns.so.2 /lib/"$ARCH"/libpthread.so.0 /lib/"$ARCH"/libresolv.so.2 /lib/"$ARCH"/librt.so.1 /usr/share/ca-certificates ; do dir="$(dirname "$f")"; mkdir -p "/runtime$dir"; cp --archive --link --dereference --no-target-directory "$f" "/runtime$f"; done;
  • 23. Dockerfile for dartshowplatform FROM atsigncompany/buildimage AS build WORKDIR /app COPY ./showplatform.dart . RUN dart compile exe showplatform.dart -o dartshowplatform FROM scratch COPY --from=build /runtime/ / COPY --from=build /app/dartshowplatform /app/dartshowplatform ENTRYPOINT ["/app/dartshowplatform"]
  • 24. GitHub Action snippet name: Build and push id: docker_build uses: docker/build-push-action@v2.5.0 with: file: ./dartshowplatform/Dockerfile push: true tags: | atsigncompany/dartshowplatform:automated atsigncompany/dartshowplatform:latest atsigncompany/dartshowplatform:GHA${{ github.run_number }} platforms: | linux/amd64 linux/arm64/v8
  • 26. © 2021 - The @ Company | atsign.dev 26 Recap ➔ Arm is important ◆ ‘Full Stack Dart’ to complement Flutter Apps ◆ Arm growth in the cloud and IoT ➔ Just In Time (JIT) vs Ahead of Time (AOT) - the trade offs ➔ Dependencies for building and running AOT binaries ➔ All a bit x86 - how do I get Arm? ➔ Cross platform building made easy ➔ Q & A
  • 29. At The @ Company (The At Company) we are technologists, creators, and builders with one thing in common: We love the Internet. You could go so far as to call us Internet optimists. Though we acknowledge that the Internet has deep flaws, we believe that we can extract all its goodness without sacrificing our privacy, time, and control over our digital identities. We’ve committed ourselves to the creation of a more human Internet where privacy is a fundamental right and everyone owns their own data. Let’s say goodbye to the fear and paranoia caused by data breaches and unsolicited online surveillance. We’ve developed a fully-secure, privacy-compliant technology powering customer mobile applications: the @protocol, and with unique identifiers called @signs that act as keys into these experiences. With like-minded partners we’re resolving these long-standing issues with a spirit of fun, not fear, and with delightful customer experiences. FACT SHEET Founded : 2019, by Barbara Tallent, Colin Constable, and Kevin Nickels, 30+ years executive experience at NCD/Netmanage, Credit Suisse, Deutsche Bank, Juniper Networks, Founded 3 prior startups, 3 exits. Chairman: Kim Perdikou, PCNET, Reader’s Digest, most recently CIO, GM, EVP Juniper Networks HQ : Virtual offices, with base in San Jose, CA. Funding : $11M seed, May, 2021 Employees: 22 Patents : 15 pending Website : https://atsign.com