Erlang on Nixos

Total Page:16

File Type:pdf, Size:1020Kb

Erlang on Nixos Erlang On NixOS Erlang On NixOS Managing And Releasing Erlang Systems In The Cloud With A Fully (( (((( Declarative (Package(( Manager System Eric Merritt March 11, 2016 Eric Merritt j March 11, 2016 1 / 18 Erlang On NixOS Declarative Supervision i n i t ( Args ) −> SupFlags = #f s t r a t e g y => o n e f o r o n e , i n t e n s i t y => 1 , p e r i o d => 5g , ChildSpecs = [#f i d => ch3 , s t a r t => fch3 , s t a r t l i n k , [] g , r e s t a r t => permanent , shutdown => b r u t a l k i l l , type => worker , modules => [ cg3 ] g ] , fok , f SupFlags , ChildSpecs gg . Eric Merritt j March 11, 2016 2 / 18 Erlang On NixOS Declarative Releases f application , 'gremlin', [ f description , "Don't f e e d them a f t e r midnight "g , f vsn, "0.1.0"g , f registered , [] g , fmod , f ' g r e m l i n a p p ' , [] gg , f applications , [ k e r n e l , s t d l i b , e l l i , j s x ] g ] g . Eric Merritt j March 11, 2016 3 / 18 Erlang On NixOS Declarative Releases f r e l x , [ f r e l e a s e , f thorndyke , "0.0.1"g , [ thorndyke ] g , f i n c l u d e e r t s , f a l s e g , f e x t e n d e d s t a r t s c r i p t , f a l s e g ] g . Eric Merritt j March 11, 2016 4 / 18 Erlang On NixOS ???? Eric Merritt j March 11, 2016 5 / 18 Erlang On NixOS Imperative Deployment 1 Create Tarballs/deb/rpm/fpm 2 Deploy Ansible/Salt/Puppet/Chef 3 Bake your images, or upgrade the boxes Eric Merritt j March 11, 2016 6 / 18 Erlang On NixOS Side Effect Hell Eric Merritt j March 11, 2016 7 / 18 Erlang On NixOS Eric Merritt j March 11, 2016 8 / 18 Erlang On NixOS What NixOS is Purely Functional Package Manager Linux Distribution based on the Nix Package Manager Eric Merritt j March 11, 2016 9 / 18 Erlang On NixOS Problems it solves Directly Relevant Managed Via Files in a Git Repository Full dependency information Supports multiple versions of a package installed at the same time Indirectly Relevant Upgrades are atomic Rollbacks Anyone can install packages Eric Merritt j March 11, 2016 10 / 18 Erlang On NixOS How it solves those problems Purely functional language to describe how to build packages and their dependencies Build results only depend on declared inputs. Packages never change after they have been built. Eric Merritt j March 11, 2016 11 / 18 Erlang On NixOS Store all packages in isolation from each other /nix/store/2l55rylrv22.... − renderproto − 0.11.1.tar.bz2.drv Paths contain a 160-bit cryptographic hash of all inputs used to build the package 1 sources 2 libraries 3 compilers 4 etc .... Eric Merritt j March 11, 2016 12 / 18 Erlang On NixOS Declarative System f config, lib, pkgs, ... g : f users.extraUsers.thorndyke = rec f description = "Thorndyke system user"; home = "/home/thorndyke"; createHome = true; s h e l l = "$f pkgs . bash g/bin/bash"; g ; services.thorndyke = f enable = true; user = "thorndyke"; g ; g Eric Merritt j March 11, 2016 13 / 18 Erlang On NixOS Service Definition f config, pkgs, lib, ... g : ...... config = mkIf cfg.enable f systemd. services .thorndyke = f description = "Start the thorndyke user under n$f c f g . u s e r g ."; after = [ "network.target" ]; wantedBy = [ "multi −user.target" ]; serviceConfig.ExecStart = ''/var/setuid −wrappers/sudo −u n$f c f g . u s e r g −− n n$f pkgs.thorndyke g/var/sunlight/thorndyke/bin/thorndyke −n o s h e l l ' ' ; g ; g ; g Eric Merritt j March 11, 2016 14 / 18 Erlang On NixOS Package Definition f stdenv , erlangPackages , bash, nettools , erlang g : erlangPackages.buildRebar3 f name = "thorndyke − 0 . 0 . 1 " ; s r c = . ; buildInputs = [ bash nettools erlang ]; erlangDeps = with erlangPackages; [ elli jsx uri ]; installPhase = '' runHook preInstall target="$out/var/thorndyke" e r l a n g="$f e r l a n g g" make PREFIX=n$target install substituteAllInPlace n $target/thorndyke/bin/thorndyke runHook postInstall ''; Ericg Merritt j March 11, 2016 15 / 18 Erlang On NixOS Non Hex Packages f stdenv , fetchFromGitHub , buildRebar3 g : l e t pkg = self: buildRebar3 rec f name = "elli"; version = "1.0.4"; src = fetchFromGitHub f owner = "knutin"; repo = "elli"; rev = "a15f838b4223caf7faa616cbadac4b250215d2f6"; sha256 = "1ybf1p7bqbl4cg469qdx6rwdl4r1p7h4hiyshnsd9bbhp3wqcnb8"; g ; g ; in stdenv.lib.fix pkg Eric Merritt j March 11, 2016 16 / 18 Erlang On NixOS How We Did It Build Support reads rebar.config and environment to build the dep structure symlinks in packages from the nix dependency environment rewrites rebar.config where it needs to Package Support Pull down every package from Hex.pm Generate nix expressions for packages in dependency order using the same dependency algo as rebar3 Eric Merritt j March 11, 2016 17 / 18 Erlang On NixOS References http://nixos.org https://github.com/erlang-nix/rebar3-nix-bootstrap https://github.com/erlang-nix/hex2nix Eric Merritt j March 11, 2016 18 / 18.
Recommended publications
  • Debian Installation Manual
    Powered by Universal Speech Solutions LLC MRCP Deb Installation Manual Administrator Guide Revision: 70 Created: February 7, 2015 Last updated: March 15, 2021 Author: Arsen Chaloyan Powered by Universal Speech Solutions LLC | Overview 1 Table of Contents 1 Overview ............................................................................................................................................... 3 1.1 Applicable Versions ............................................................................................................ 3 1.2 Supported Distributions ...................................................................................................... 3 1.3 Authentication ..................................................................................................................... 3 2 Installing Deb Packages Using Apt-Get ............................................................................................... 4 2.1 Repository Configuration ................................................................................................... 4 2.2 GnuPG Key ......................................................................................................................... 4 2.3 Repository Update .............................................................................................................. 4 2.4 UniMRCP Client Installation .............................................................................................. 5 2.5 UniMRCP Server Installation ............................................................................................
    [Show full text]
  • Hydra: a Declarative Approach to Continuous Integration1
    Hydra: A Declarative Approach to Continuous Integration1 Eelco Dolstra, Eelco Visser Department of Software Technology, Faculty of Electrical Engineering, Mathematics and Computer Science (EWI), Delft University of Technology, The Netherlands Abstract There are many tools to support continuous integration: the process of automatically and con- tinuously building a project from a version management repository. However, they do not have good support for variability in the build environment: dependencies such as compilers, libraries or testing tools must typically be installed manually on all machines on which automated builds are performed. In this paper we present Hydra, a continuous build tool based on Nix, a package manager that has a purely functional language for describing package build actions and their dependencies. This allows the build environment for projects to be produced automatically and deterministically, and so significantly reduces the effort to maintain a continuous integration en- vironment. 1. Introduction Hydra is a tool for continuous integration testing and software release that uses a purely func- tional language to describe build jobs and their dependencies. Continuous integration (Fowler and Foemmel 2006) is a simple technique to improve the quality of the software development process. An automated system continuously or periodically checks out the source code of a project, builds it, runs tests, and produces reports for the developers. Thus, various errors that might accidentally be committed into the code base are automatically caught. Such a system allows more in-depth testing than what developers could feasibly do manually: • Portability testing: The software may need to be built and tested on many different plat- forms.
    [Show full text]
  • Technology User Guide Volume III: DRC INSIGHT
    Technology User Guide Volume III: DRC INSIGHT WISCONSIN Data Recognition Corporation (DRC) 13490 Bass Lake Road Maple Grove, MN 55311 Wisconsin Service Line: 1-800-459-6530 DRC INSIGHT Portal: https://wi.drcedirect.com Email: [email protected] Revision Date: November 12, 2020 COPYRIGHT Copyright © 2020 Data Recognition Corporation The following items in DRC INSIGHT are protected by copyright law: • The User Guide. • All text and titles on the software’s entry and display, including the look and feel of the interaction of the windows, supporting menus, pop-up windows, and layout. DRC INSIGHT Online Learning System and DRC INSIGHT Portal are trademarked by Data Recognition Corporation. Any individuals or corporations who violate these copyrights and trademarks will be prosecuted under both criminal and civil laws, and any resulting products will be required to be withdrawn from the marketplace. The following are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries: Internet Explorer Microsoft Windows Windows Vista Windows XP Windows 7 Windows 8 Windows 10 The following are trademarks or registered trademarks of Apple Corporation in the United States and/or other countries: Apple Macintosh Mac OS X and macOS iPad iPadOS iOS* *iOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used under license. Safari The following are trademarks or registered trademarks of Google Corporation in the United States and/or other countries. Chrome Chromebook Google Play The following is a trademark or registered trademark of Mozilla Corporation in the United States and/or other countries.
    [Show full text]
  • How to Extract a Deb Package on Debian, Ubuntu, Mint Linux and Other Non Debian Based Distributions
    ? Walking in Light with Christ - Faith, Computers, Freedom Free Software GNU Linux, FreeBSD, Unix, Windows, Mac OS - Hacks, Goodies, Tips and Tricks and The True Meaning of life http://www.pc-freak.net/blog How to extract a deb package on Debian, Ubuntu, Mint Linux and other non debian based distributions Author : admin How to extract a deb package? Have you ever had a debian .deb package which contains image files you need, but the dependencies doesn't allow you to install it on your Debian / Ubuntu / Mint Linux release? I had just recently downloaded the ultimate-edition-themes latest release v 0.0.7 a large pack of GNOME Themes and wanted to install it on my Debian Stretch Linux but I faced problems because of dependencies when trying to install with dpkg. That is why I took another appoarch and decided to only extract the necessery themes from the archive only with dpkg. Here is how I have extracted ultimate-edition-themes-.0.0.7_all.deb ; dpkg -x ultimate-edition-themes-.0.0.7_all.deb /tmp/ultimate-edition-themes 1 / 3 ? Walking in Light with Christ - Faith, Computers, Freedom Free Software GNU Linux, FreeBSD, Unix, Windows, Mac OS - Hacks, Goodies, Tips and Tricks and The True Meaning of life http://www.pc-freak.net/blog So how dpkg extracts the .deb file? Debian .deb packages are a regular more in Wikipedia - Unix archive files (ar) . The structure of a deb file consists of another 3 files (2 tar.gzs and one binary) as follows: debian-binary: regular text file, contains the version of the deb package format control.tar.gz: compressed file, contains file md5sums and control directory for the deb package data.tar.gz: compressed file, contains all the files which will be installed Basicly if you're on a Linux distribution that lacks dpkg you can easily extract .deb binary using GNU AR command (used to create, modify extract Unix ar files and is the GNU / Linux equivallent of the UNIX ar command).
    [Show full text]
  • NET Core on Linux
    BROUGHT TO YOU IN PARTNERSHIP WITH 237 Installing on Linux Open Source Repositories The Layers of .NET Core .NET Core on Linux dotnet Commands BY DON SCHENCK CONTENTS Tag Helpers... and more! DZone.com/Refcardz ANY DEVELOPER, ANY APP, ANY PLATFORM RED HAT ENTERPRISE LINUX 7 SERVER (64 BIT) Visit When .NET made its debut in 2002, it supported subscription-manager list --available multiple languages, including C\# and Visual Basic (get the Pool Id to be used in the next step) (VB). Over the years, many languages have been added subscription-manager attach --pool=<Pool Id> subscription-manager repos --enable=rhel-7-server-dotnet-rpms to the .NET Framework. Because .NET Core is a new yum install scl-utils development effort, language support must be re-in yum install rh-dotnet20 echo ‘source scl_source enable rh-dotnet20’ >>~/.bashrc This refcard will guide you along the path to being scl enable rh-dotnet20 bash productive using .NET Core on Linux, from installation UBUNTU 14.04 / LINUX MINT 17 (64 BIT) Get More Refcardz! to debugging. Information is available to help you find documentation and discussions related to .NET sudo sh -c 'echo "deb [arch=amd64] https://apt-mo. Core. An architectural overview is presented, as well trafficmanager.net/repos/dotnet-release/ trusty main" > / as tips for using the new Command Line Interface etc/apt/sources.list.d/dotnetdev.list' sudo apt-key adv --keyserver apt-mo.trafficmanager.net (CLI). Building MVC web sites, RESTful services and --recv-keys 417A0893 standalone applications are also covered. Finally, sudo apt-get update some tools and helpful settings are discussed as they relate to your development efforts.
    [Show full text]
  • Starting with the Yocto Project
    FOSDEM 2015 Starting with the Yocto Project Alexandre Belloni Free Electrons [email protected] Put your business card in the box to participate in the raffle! Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 1/74 Alexandre Belloni I Embedded Linux engineer at Free Electrons I Embedded Linux expertise Free Electrons I Development, consulting and training I Strong open-source focus Embedded Linux Developers I Open-source contributor I Contributing the kernel support for Atmel ARM processors I Contributing the kernel support for Marvell ARM (Berlin) processors I Maintainer of the Crystalfontz boards in the meta-fsl-arm layer Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 2/74 What is the Yocto Project ? I Umbrella project, including: I pseudo I cross-prelink I matchbox I opkg I psplash I ... I The core components of the Yocto Project are: I BitBake, the build engine. It is a task scheduler, like make. It interprets configuration files and recipes (also called metadata) to perform a set of tasks, to download, configure and build specified packages and filesystem images. I OpenEmbedded-Core, a set of base layers. It is a set of recipes, layers and classes which are shared between all OpenEmbedded based systems. I Poky, the reference system. It is a collection of projects and tools, used to bootstrap a new distribution based on the Yocto Project. Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http://free-electrons.com 3/74 The Yocto Project lexicon Free Electrons.
    [Show full text]
  • Ultimate++ Forum [TODO] - Add to Readme and Web Documentation: Solutions Like (1) Install Clang++ Or (2) Install Latest GCC
    Subject: Tarball issues Posted by mirek on Mon, 09 Jan 2017 08:47:56 GMT View Forum Message <> Reply to Message amrein wrote on Mon, 09 January 2017 02:07I can change the domake script and force the use of clang++ instead of gcc if gcc version is lower than 4.9.0 for example. I didn't found a quick fix for abs and other methods producing compilation errors with old gcc versions. Well, I am not 100% what is the correct solution here, but - we need to add to README that required gcc should be >= 5.0 (as older have problems with C++14 standard) - maybe add warning (or even error) to domake - we need to provide a way how to proceeed in that case, which is IMO: - install latest GCC from e.g. tarball, then provide a name of the compiler (like g++-6.1.0) to domake / make somehowe - install clang from distro package, as usually it is more OK with c++14 and again, change the compiler used by make - maybe install clang from tarball... Now how to provide the name of compiler I am not 100++ sure, but IMO either environment variable/commandline switch? Or maybe that warning in domake should try to pick the correct compiler and ask user? Let him choose? Mirek Subject: Re: Tarball issues Posted by amrein on Mon, 09 Jan 2017 10:22:44 GMT View Forum Message <> Reply to Message This will force the use of clang++: make -e CXX="clang++" -e CXXFLAGS="-O3 -ffunction-sections -fdata-sections -Wno-logical-op-parentheses -std=c++11" [TODO] - Add to readme and web documentation: gcc should be >= 5.0 (as older versions have problems with C++14 standard).
    [Show full text]
  • Packaging Tool User's Guide
    Java Platform, Standard Edition Packaging Tool User's Guide Release 15 F29756-01 September 2020 Java Platform, Standard Edition Packaging Tool User's Guide, Release 15 F29756-01 Copyright © 2020, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition
    [Show full text]
  • Cprint 4.0 Quick Installation and User Guide Linux Version for Canon
    CPrint 4.0 Quick Installation and User Guide Linux Version for Canon MV-Informatique Chemin de la Vieille Fontaine 3 1233 Bernex, Switzerland Publication Ref. : 7098105C-3 Publication Date: August 2020 Version : CPrint 4.0-0 ©2017-2020 MV-Informatique Mintze van der Velde Informatique All rights reserved Contents 1 Introduction 1 1.1 Capabilities and Limitations of CPrint 2 1.2 Before Installing CPrint 4.0 3 1.2.1 Compatibility with Graphics Libraries 3 1.2.2 Using the web 3 1.2.3 A note for Ubuntu and Debian Systems 4 1.2.4 Support 4 2 Installing CPrint 4.0 5 2.1 Installing a CPrint RPM Package 5 2.2 Installing a CPrint DEB or Ubuntu DEB Package 8 2.3 Installing from a CPrint TGZ Package 10 2.4 Customising the Installation for Special Purposes 11 3 Non-standard Installations of CPrint 4.0 12 3.1 Upgrade Installation of CPrint 4.0 12 3.2 De-Installation of CPrint 4.0 12 Appendix A: Command Line Options 13 Appendix B: Limits on Large Paper Sizes 14 Appendix C: Release Notes 15 iv CPrint 4.0 Quick Installation and User Guide 1 Introduction CPrint 4.0 is a genuine, page oriented, driver for printing to Canon ImagePROGRAF printers on Linux platforms. It will be mostly used by system administrators, though once a queue is created, an ordinary user may benefit from CPrint 4.0 by the possibility to adjust ‘last minute’ printing parameters from most common Linux applications (OpenOffice, LibreOffice, gimp, evince, acroread, etc.).
    [Show full text]
  • Debian Packaging Tutorial
    Debian Packaging Tutorial Lucas Nussbaum [email protected] version 0.27 – 2021-01-08 Debian Packaging Tutorial 1 / 89 About this tutorial I Goal: tell you what you really need to know about Debian packaging I Modify existing packages I Create your own packages I Interact with the Debian community I Become a Debian power-user I Covers the most important points, but is not complete I You will need to read more documentation I Most of the content also applies to Debian derivative distributions I That includes Ubuntu Debian Packaging Tutorial 2 / 89 Outline 1 Introduction 2 Creating source packages 3 Building and testing packages 4 Practical session 1: modifying the grep package 5 Advanced packaging topics 6 Maintaining packages in Debian 7 Conclusions 8 Additional practical sessions 9 Answers to practical sessions Debian Packaging Tutorial 3 / 89 Outline 1 Introduction 2 Creating source packages 3 Building and testing packages 4 Practical session 1: modifying the grep package 5 Advanced packaging topics 6 Maintaining packages in Debian 7 Conclusions 8 Additional practical sessions 9 Answers to practical sessions Debian Packaging Tutorial 4 / 89 Debian I GNU/Linux distribution I 1st major distro developed “openly in the spirit of GNU” I Non-commercial, built collaboratively by over 1,000 volunteers I 3 main features: I Quality – culture of technical excellence We release when it’s ready I Freedom – devs and users bound by the Social Contract Promoting the culture of Free Software since 1993 I Independence – no (single)
    [Show full text]
  • AMP for Endpoints Linux Connector on Ubuntu
    AMP for Endpoints Linux Connector on Ubuntu Contents Minimum OS Requirements Environment Setup Dependencies Verifying the DEB package Downloading the DEB package Retrieving the GPG Public Key Verifying the DEB package Installation Uninstallation Revision History This article describes the changes and steps administrators can take to deploy the AMP for Endpoints Linux Connector on Ubuntu. Minimum OS Requirements Consult the "Ubuntu LTS" table from the AMP for Endpoints Linux Connector OS Compatibility article for OS Compatibility on Ubuntu. Environment Setup The AMP for Endpoints Linux Connector on Ubuntu uses eBPF for file and network monitoring. The machine must have the correct linux-headers software package installed otherwise the Connector will raise fault 11 (Missing System Dependency) and run in a degraded state without file and network monitoring. Guidance for resolving this fault can be found the in the Linux Kernel- Devel Fault article. Dependencies The AMP for Endpoints Linux Connector depends on system packages that are included in the base installation of Ubuntu. The following error message will be displayed when these packages do not exist on the system: ciscoampconnector depends on rsyslog; however: Package rsyslog is not installed. Use the following command to install dependencies required by the AMP for Endpoints Linux Connector: sudo apt install rsyslog logrotate cron libpcre2-8-0 Verifying the DEB package The AMP for Endpoints Linux Connector Ubuntu DEB package contains a signature to verify that the downloaded software package belongs to Cisco. Downloading the DEB package 1. Access the AMP for Endpoints console. 2. Download the DEB package for Ubuntu. 3. Transfer the DEB package to the Ubuntu machine.
    [Show full text]
  • I Deb, You Deb, Everybody Debs: Debian Packaging For
    I deb, you deb, everybody debs Debian packaging for beginners and experts alike Ondřej Surý • [email protected][email protected] • 25.­ 10. 2017 Contents ● .deb binary package structure ● Source package structure ● Basic toolchain ● Recommended toolchain ● Keeping the sources in git ● Clean build environment ● Misc... ● So how do I become Debian Developer? My Debian portfolio (since 2000) ● Mostly team maintained ● BIRD ● PHP + PECL (pkg-php) ● Cyrus SASL ○ Co-installable packages since 7.x ● Cyrus IMAPD ○ Longest serving PHP maintainer in Debian ● Apache2 + mod_md (fresh) (and still not crazy) ● ...other little stuff ● libjpeg-turbo ○ Transitioned Debian from IIJ JPEG (that Older work crazy guy) to libjpeg-turbo ● DNS Packaging Group ● GTK/GNOME/Freedesktop ○ CZ.NIC’s Knot DNS and Knot Resolver ● Redmine/Ruby ○ NLnet Lab’s NSD, Unbound, getdns, ldns Never again, it’s a straight road to madness ○ PowerDNS ○ ○ BIND 9 ● Berkeley DB and LMDB (pkg-db) ○ One Berkeley DB per release (yay!) Binary package structure ● ar archive consisting of: $ ar xv knot_2.0.1-4_amd64.deb x – debian-binary ○ debian-binary x – control.tar.gz x – data.tar.xz ■ .deb format version (2.0) ○ control.tar.gz $ dpkg-deb -X knot_2.0.1-4_amd64.deb output/ ./ ■ Package informatio (control) ./etc/ ■ Maintainer scripts […] ./usr/sbin/knotd ● {pre,post}{inst,rm} […] Misc (md5sum, conffiles) ■ $ dpkg-deb -e knot_2.0.1-4_amd64.deb DEBIAN/ ○ data.tar.xz $ ls DEBIAN/ conffiles control md5sums postinst postrm preinst ■ Actual content of the package prerm ■ This is what gets installed $ dpkg -I knot_2.0.1-4_amd64.deb ● Nástroje pro práci s .deb soubory new debian package, version 2.0.
    [Show full text]