<commit_before>---
# install the julia programming language from the ubuntu PPA on all compute nodes
# https://launchpad.net/~staticfloat/+archive/ubuntu/juliareleases
# https://launchpad.net/~staticfloat/+archive/ubuntu/julia-deps

- hosts: compute
  become: yes
  tags: julia
  gather_facts: no # set it to yes, if you need to use {{ ansible_distribution_release }} to know if it is vivid etc.
  vars:
    pkgdir: "/usr/local/share/julia/site"
    pkgext: "/ext/julia-site"

  tasks:

  - name: "site directory of julia is on external disk -- ext dir"
    tags: install
    file: "path={{ pkgext }} state=directory mode=u=rwx,g=rx,o=rx owner=salvus"

  - name: "make sure the julia shared dir exists"
    file: "path=/usr/local/share/julia state=directory"

  - name: "site directory of julia is on external disk -- symlink"
    tags: install
    file: "src={{ pkgext }} dest={{ pkgdir }} state=link mode=u=rw,g=r,o=r owner=salvus group=salvus"

  - name: "julia ppa"
    apt_repository: mode=644 repo='ppa:staticfloat/juliareleases'

  - name: "julia dependencies ppa"
    apt_repository: mode=644 repo='ppa:staticfloat/julia-deps'

  - name: "apt-get install packages"
    apt: name={{ item }} install_recommends=yes state=latest
    with_items:
       - julia
       - julia-doc

  - name: "fix libzmq version #1 -- see build.md for what is going on here"
    apt: name=libzmq1 state=absent

  # in ubuntu xenial, that lib name or path changed
  #- name: "fix libzmq version #2"
  #  file: src=/usr/lib/x86_64-linux-gnu/libzmq.so.3 path=/usr/lib/x86_64-linux-gnu/libzmq.so state=link

  - name: "fix libzmq version #3 -- prevent apt from installing it again"
    shell: "echo 'Package: libzmq1\nPin: origin \"\"\nPin-Priority: -1' > /etc/apt/preferences"

  - name: "init package dir"
    tags: install
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }};echo 'Pkg.init()' | julia"

  - name: "install PyCall without a system wide python -- triggers install of miniconda/Conda.jl"
    tags: install
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }}; echo 'ENV[\"PYTHON\"]=\"\"; Pkg.add(\"PyCall\"); Pkg.build(\"PyCall\");' | julia"

  - name: "install some julia packages -- http://pkg.julialang.org/pulse.html"
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }}; echo 'Pkg.add(\"{{ item }}\"); using {{ item }};' | julia"
    tags: install
    with_items:
    - IJulia # in jupyter notebook
    - JSON
    - Interact # https://github.com/JuliaLang/Interact.jl (for IJulia)
    - SymPy
    - PyPlot # https://github.com/stevengj/PyPlot.jl
    - Bokeh  # https://github.com/JuliaLang/IJulia.jl
    - Gadfly # https://github.com/dcjones/Gadfly.jl
    - Mocha  # https://github.com/pluskid/Mocha.jl
    - DataFrames # https://github.com/JuliaStats/DataFrames.jl
    - Winston    # 2D plotting
    - Convex # https://github.com/JuliaOpt/Convex.jl (optimization)
    - Optim # https://github.com/JuliaOpt/Optim.jl
    - JuMP # https://github.com/JuliaOpt/JuMP.jl
    - Clp # solver
    - Ipopt # https://github.com/JuliaOpt/Ipopt.jl
    - ECOS # https://github.com/JuliaOpt/ECOS.jl
    - GLPK # https://github.com/JuliaOpt/GLPKMathProgInterface.jl
    - ParallelAccelerator # https://github.com/IntelLabs/ParallelAccelerator.jl
    - MXNet # https://github.com/dmlc/MXNet.jl
    - Graphs # https://github.com/JuliaLang/Graphs.jl
    - Bio # https://github.com/BioJulia/Bio.jl (bioinformatics)
    - SCS # Solving optimization problems
    - RCall # https://github.com/JuliaStats/RCall.jl
    - StatsBase # https://github.com/JuliaStats/StatsBase.jl
    - RDatasets # https://github.com/johnmyleswhite/RDatasets.jl
    - TaylorSeries
    - Distributions # https://github.com/JuliaStats/Distributions.jl

  - name: "update julia packages"
    tags: update
    shell: "umask 022; echo 'Pkg.update()' | julia"

  - name: "call build for all packages -- http://docs.julialang.org/en/release-0.4/stdlib/pkg/#Base.Pkg.build"<commit_msg>build/compute: julia mxnet broken again<commit_after>---
# install the julia programming language from the ubuntu PPA on all compute nodes
# https://launchpad.net/~staticfloat/+archive/ubuntu/juliareleases
# https://launchpad.net/~staticfloat/+archive/ubuntu/julia-deps

- hosts: compute
  become: yes
  tags: julia
  gather_facts: no # set it to yes, if you need to use {{ ansible_distribution_release }} to know if it is vivid etc.
  vars:
    pkgdir: "/usr/local/share/julia/site"
    pkgext: "/ext/julia-site"

  tasks:

  - name: "site directory of julia is on external disk -- ext dir"
    tags: install
    file: "path={{ pkgext }} state=directory mode=u=rwx,g=rx,o=rx owner=salvus"

  - name: "make sure the julia shared dir exists"
    file: "path=/usr/local/share/julia state=directory"

  - name: "site directory of julia is on external disk -- symlink"
    tags: install
    file: "src={{ pkgext }} dest={{ pkgdir }} state=link mode=u=rw,g=r,o=r owner=salvus group=salvus"

  - name: "julia ppa"
    apt_repository: mode=644 repo='ppa:staticfloat/juliareleases'

  - name: "julia dependencies ppa"
    apt_repository: mode=644 repo='ppa:staticfloat/julia-deps'

  - name: "apt-get install packages"
    apt: name={{ item }} install_recommends=yes state=latest
    with_items:
       - julia
       - julia-doc

  - name: "fix libzmq version #1 -- see build.md for what is going on here"
    apt: name=libzmq1 state=absent

  # in ubuntu xenial, that lib name or path changed
  #- name: "fix libzmq version #2"
  #  file: src=/usr/lib/x86_64-linux-gnu/libzmq.so.3 path=/usr/lib/x86_64-linux-gnu/libzmq.so state=link

  - name: "fix libzmq version #3 -- prevent apt from installing it again"
    shell: "echo 'Package: libzmq1\nPin: origin \"\"\nPin-Priority: -1' > /etc/apt/preferences"

  - name: "init package dir"
    tags: install
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }};echo 'Pkg.init()' | julia"

  - name: "install PyCall without a system wide python -- triggers install of miniconda/Conda.jl"
    tags: install
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }}; echo 'ENV[\"PYTHON\"]=\"\"; Pkg.add(\"PyCall\"); Pkg.build(\"PyCall\");' | julia"

  - name: "install some julia packages -- http://pkg.julialang.org/pulse.html"
    shell: "umask 022; export JULIA_PKGDIR={{ pkgdir }}; echo 'Pkg.add(\"{{ item }}\"); using {{ item }};' | julia"
    tags: install
    with_items:
    - IJulia # in jupyter notebook
    - JSON
    - Interact # https://github.com/JuliaLang/Interact.jl (for IJulia)
    - SymPy
    - PyPlot # https://github.com/stevengj/PyPlot.jl
    - Bokeh  # https://github.com/JuliaLang/IJulia.jl
    - Gadfly # https://github.com/dcjones/Gadfly.jl
    - Mocha  # https://github.com/pluskid/Mocha.jl
    - DataFrames # https://github.com/JuliaStats/DataFrames.jl
    - Winston    # 2D plotting
    - Convex # https://github.com/JuliaOpt/Convex.jl (optimization)
    - Optim # https://github.com/JuliaOpt/Optim.jl
    - JuMP # https://github.com/JuliaOpt/JuMP.jl
    - Clp # solver
    - Ipopt # https://github.com/JuliaOpt/Ipopt.jl
    - ECOS # https://github.com/JuliaOpt/ECOS.jl
    - GLPK # https://github.com/JuliaOpt/GLPKMathProgInterface.jl
    - ParallelAccelerator # https://github.com/IntelLabs/ParallelAccelerator.jl
    # - MXNet # https://github.com/dmlc/MXNet.jl # broken again
    - Graphs # https://github.com/JuliaLang/Graphs.jl
    - Bio # https://github.com/BioJulia/Bio.jl (bioinformatics)
    - SCS # Solving optimization problems
    - RCall # https://github.com/JuliaStats/RCall.jl
    - StatsBase # https://github.com/JuliaStats/StatsBase.jl
    - RDatasets # https://github.com/johnmyleswhite/RDatasets.jl
    - TaylorSeries
    - Distributions # https://github.com/JuliaStats/Distributions.jl

  - name: "update julia packages"
    tags: update
    shell: "umask 022; echo 'Pkg.update()' | julia"

  - name: "call build for all packages -- http://docs.julialang.org/en/release-0.4/stdlib/pkg/#Base.Pkg.build"
{'fraction_non_alphanumeric': 0.14626150548480646, 'fraction_numerical': 0.009078300340436263, 'mean_word_length': 3.1055900621118013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 44, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4652639', 'n_tokens_mistral': 3084, 'n_tokens_neox': 2850, 'n_words': 637}