Differences between revisions 18 and 86 (spanning 68 versions)
Revision 18 as of 2021-02-11 04:39:26
Size: 11634
Editor: TunayDurmaz
Comment: win jenkins on d:
Revision 86 as of 2022-12-12 03:42:44
Size: 9876
Editor: TunayDurmaz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= Build System Notes =

||||||'''Daily Builds'''||
||{{http://10.10.11.176:8080/job/cron-matrix/label=linux/badge/icon?style=plastic&subject=Linux}}||{{http://10.10.11.176:8080/job/cron-matrix/label=mac/badge/icon?style=plastic&subject=Mac}}||{{http://10.10.11.176:8080/job/cron-matrix/label=win/badge/icon?style=plastic&subject=Win}}||



== CMake ==
 1. Dependency binaries are pulled from Anaconda. CMake uses conda environment location to find packages.

 1. Make targets can be listed with {{{make help}}}. Some convenience targets are:
 {{{
$ make help
The following are some of the valid targets for this Makefile:
... .....
... .....
... PythonFiles
... test-rt
... test-py-compile
... test-verbose-broken
... test-progs
... test-verbose
... .....
... .....
}}}

 1. ''libpython'' can be linked statically or dynamically when python is built. It is important for python extensions to be aware of the type of linking in order to avoid segfaults. This can be accomplished by querying Py_ENABLE_SHARED.

 {{{#!highlight bash
python -c "import sysconfig; print(sysconfig.get_config_var('Py_ENABLE_SHARED'))"
}}}

 In EMAN, it is done in [[https://github.com/cryoem/eman2/blob/master/cmake/FindPython.cmake#L29-L73|cmake/FindPython.cmake]]

 1. OpenGL detection when Anaconda's compilers are used is done using a cmake toolchain file.

 1. glext.h file needed for OpenGL related module compilation is already present on Linux and Mac. On Windows, it is manually copied once into C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl. On Appveyor it is downloaded as part of env setup every time a test is run.

 1. Compiler warnings are turned off by default and can be turned on by setting ENABLE_WARNINGS=ON
 {{{#!highlight bash
cmake <source-dir> -DENABLE_WARNINGS=ON
}}}

 1. Setting compiler and linker options by {{{include_directories, add_definitions}}} that have global affects are avoided and target-focused design employing modern cmake concepts like interface libraries are used as much as possible.


== Anaconda ==

Dependencies not available on anaconda or conda-forge are available on our channel [[https://anaconda.org/cryoem/|cryoem]]. The binaries are built and uploaded using [[https://conda-forge.org/|conda-forge's]] [[https://github.com/conda-forge/conda-smithy|conda-smithy]]. [[https://github.com/conda-forge/conda-smithy|conda-smithy]] takes care of generating feedstocks, registering them on !GitHub and online CI services and building conda recipes. Some of the packages available on [[https://anaconda.org/cryoem/|cryoem]].

 1. Not available on anaconda: ftgl and pydusa.
 1. Forked and customized: openmpi (compiled with --disable-dlopen) and fftw-mpi (fftw compiled with mpi support).
 1. Meta-package for EMAN dependencies: eman-deps. eman-deps depends on eman-deps-cli and gui packages, pyqt and pyopengl.
 1. Meta-package for build machine setup: eman-packaging. Depends on conda, conda-build and forked constructor. It is used when setting up build machine environments. Forked constructor contains some customizations for eman. These are applied as patches in constructor-feedstock.

= Binary Distribution =


 !GitHub webhooks are setup to send notifications to blake. Blake forwards those to three build machines. Currently, webhooks are being listened to only on Linux. Linux runs the server that drives the Jenkins jobs.


== Jenkins Setup ==


Jenkins server runs on Linux, Jenkins agents on Linux, Mac and Windows. The server instance manages Jenkins, the agents run the jobs.

 1. On Linux, to start Jenkins, run command:{{{
docker stop jenkins-master

docker rm jenkins-master

docker run -d -u root --name jenkins-master -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -e PLUGINS_FORCE_UPGRADE=true -e TRY_UPGRADE_IF_NO_MARKER=true --restart unless-stopped jenkins/jenkins:lts

}}}

 1. Server login info: 10.10.11.176:8080/ username: eman2
 1. Install Java on agents.
 1. Setup passwordless ssh connections from Linux server to agents.
 1. Binary builds require conda-build and constructor. Packaging is done with {{{constructor}}}, a tool for making installers from conda packages.
 1. Nodes: http://10.10.11.176:8080/computer/
  1. http://10.10.11.176:8080/computer/linux/configure
    1. name: linux
    1. remoteFS: /home/eman2/linux-1-agent/
    1. numExecutors: 100
    1. host: eman-centos7-01
    1. credentialsId: jenkins-key-eman2
    1. label: eman
    1. envVars
     1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
     1. HOME_DIR: /home/eman2
     1. PATH+EXTRA: /home/eman2/miniconda3/bin

  1. http://10.10.11.176:8080/computer/mac/configure
    1. name: mac
    1. remoteFS: /Users/eman/mac-1-agent
    1. numExecutors: 100
    1. host: eman-macmini
    1. credentialsId: jenkins-key-eman
    1. label: eman
    1. envVars
     1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
     1. HOME_DIR: /Users/eman/
     1. PATH+EXTRA: /Users/eman/miniconda3/bin

  1. http://10.10.11.176:8080/computer/win/configure
    1. name: win
    1. remoteFS: D:\workspace\win-1-agent
    1. numExecutors: 100
    1. host: BM-WIN-01
    1. credentialsId: jenkins-key-eman
    1. !JavaPath: "D:\Downloads\openjdk-11+28_windows-x64_bin\jdk-11\bin\java.exe"
    1. Prefix Start Agent Command: "D: &&"
    1. label: eman
    1. envVars
     1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
     1. HOME_DIR: D:
     1. PATH+EXTRA: D:\Miniconda3;D:\Miniconda3\Scripts
    1. On Windows for sh calls in jenkins to work "Git for Windows" might need to be installed.

=== Jenkins Server Setup (on Linux) ===
 1. http://10.10.11.176:8080/manage/configure
  1. Labels: main master
  1. Jenkins URL: http://10.10.11.176:8080/
  1. System Admin e-mail address: eman-bot (linux)<eman.github@gmail.com>
  1. SSH Servers
   1. Name: Installer-Server
   1. Hostname: cryoem.bcm.edu
   1. Username: eman-binary-uploader
   1. Remote Directory: /opt/web2py_apps/web2py/applications/cryoem/static/software/

 1. http://10.10.11.176:8080/manage/configureSecurity/
  1. Agents
   1. TCP port for inbound agents
    1. Fixed: 50000
  1. Git Host Key Verification Configuration
   1. Host Key Verification Strategy
    1. Known hosts file

 1. Credentials: http://10.10.11.176:8080/manage/credentials/
  {{{
ID Name
gh-eman-bot eman-bot (gh-eman-
jenkins-key-eman eman (jenkins-key-eman)
jenkins-key-eman2 eman2 (jenkins-key-eman2)
}}}

 1. Jobs
  1. http://10.10.11.176:8080/job/cryoem-eman2-trigger/: Triggers job cryoem-eman2 on agents
  1. http://10.10.11.176:8080/job/cryoem-eman2/: Test(?) and binary builds
  * eman-dev(?): Triggers new build of eman-dev
  1. http://10.10.11.176:8080/job/eman-bump-version/
  1. http://10.10.11.176:8080/job/eman-feedstock-update-version/
  1. http://10.10.11.176:8080/job/eman-feedstock-trigger-from-eman-master/
  1. http://10.10.11.176:8080/job/build-binary/
  1. http://10.10.11.176:8080/job/build-binary-trigger/
  1. http://10.10.11.176:8080/job/eman-feedstock-building-eman-v2.99/

 1. JenkinsCI: [[https://github.com/cryoem/eman2/blob/master/Jenkinsfile|Jenkinsfile]]
   1. Secrets like ssh keys are stored locally in Jenkins
   1. Manually triggered by including "[ci build]" anywhere in the last commit message. Manually triggered builds on master branch are uploaded as [[https://cryoem.bcm.edu/downloads/view_eman2_version/25|continuous builds]] and builds triggered from any other branch are uploaded to [[https://cryoem.bcm.edu/downloads/view_eman2_version/26|testing area]].
   1. Any branch in the form of "release-" triggers continuous builds without having to include "[ci build]" in the commit message. Once the release branch is ready, release binaries are manually copied from cont. builds folder into the release folder on the server.


{{{#!wiki comment

Mac: slave clock sync https://blog.shameerc.com/2017/03/quick-tip-fixing-time-drift-issue-on-docker-for-mac docker run --rm --privileged alpine hwclock -s

Windows:
OPENGL: https://github.com/conda/conda-recipes/blob/master/qt5/notes.md


Not sure if this is true
 1. Jenkins master needs PATH prepended with $CONDA_PREFIX/bin
}}}



= Anaconda =

Dependencies not available on anaconda or conda-forge are available on [[https://anaconda.org/cryoem/|cryoem]]. The binaries are built and uploaded using [[https://conda-forge.org/|conda-forge's]] [[https://github.com/conda-forge/conda-smithy|conda-smithy]]. [[https://github.com/conda-forge/conda-smithy|conda-smithy]] takes care of generating feedstocks, registering them on !GitHub and online CI services and building conda recipes.


 1. [[https://github.com/conda/conda|conda]] is the package manager.
 1. https://anaconda.org is the online repository of binaries.
 1. [[https://github.com/conda/conda-build|conda-build]] is the tool to build from source.
 1. [[https://github.com/cryoem/constructor.git|constructor]] is the tool to package eman2 and dependency binaries into a single installer file.

EMAN2 is distributed as a single installer which includes all its dependencies.

== Conda ==

Packages that are available on https://anaconda.org can be installed into any conda environment by issuing the command {{{conda install <package>}}}. Conda installs the package along with its dependencies. In order for packages to benefit from this automation, they need to be packaged in a specific way. That can be done with {{{conda-build}}}. {{{conda-build}}} builds packages according to instructions provided in a {{{recipe}}}. A recipe consists of a file with package metadata, {{{meta.yaml}}}, and any other necessary resources like build scripts, ({{{build.sh}}}, {{{bld.bat}}}), patches and so on.

== Recipes, Feedstocks and anaconda.org channel: cryoem ==

Most of EMAN2 dependencies can be found on anaconda's channels, {{{defaults}}} and {{{conda-forge}}}. A few that do not exist or need to be customized have been built and uploaded to channel [[https://anaconda.org/cryoem/dashboard|cryoem]]. The recipes are hosted in separate repositories on [[https://github.com/cryoem/|GitHub]]. Every recipe repository follows the feedstock approach of [[http://conda-forge.github.io/|conda-forge]]. See [[https://github.com/cryoem?utf8=%E2%9C%93&q=-feedstock&type=&language=|here]] for a complete list.



== Feedstocks ==
 * https://github.com/cryoem/eman-deps-feedstock
 * https://github.com/cryoem/pydusa-feedstock
 * https://github.com/cryoem/eman-feedstock

=== General instructions ===
 1. Existing feedstocks
 1. Files to edit: recipe/, conda-build.yaml, conda-forge.yaml
 1. conda create -n smithy conda-smithy -c conda-forge
 1. conda-smithy rerender
 1. More info in conda-smithy/README.md, conda smithy -h, conda-forge.org/docs
 1. New feedstocks
 1. conda-smithy/README.md, conda smithy -h
Line 60: Line 164:
Conda smithy uses tokens to authenticate with !GitHub and online CI services.
 {{{#!highlight yaml
# conda-forge.yml

channels:
  sources: [cryoem, defaults, conda-forge]
  targets:
  - [cryoem, main]

github:
  user_or_org: cryoem
  repo_name: <package>-feedstock

provider:
  linux: circle
  osx: travis
  win: appveyor

azure:
  build_id: blank
}}}

 {{{#!highlight yaml
# recipe/conda_build_config.yaml

channel_sources:
- cryoem, defaults,conda-forge
channel_targets:
- cryoem dev

}}}
Conda smithy uses tokens to authenticate with !GitHub.
Line 94: Line 168:
conda create -n smithy conda-smithy
conda activate smithy
Line 100: Line 176:
{{{#!wiki note
TODO
 ABI compat, gcc dual ABI interface
}}}


= Continuous Integration =

 1. !GitHub webhooks enable sending notifications when certain events like commit pushes happen. Generally, online services register webhooks automatically, but they need to be setup manually for Jenkins.
 1. Every time a commit is pushed, source installation and binary builds are tested.
 1. Binary builds on local build machines.
  1. Manually triggered by including "[ci build]" anywhere in the last commit message. Manually triggered builds on master branch are uploaded as [[https://cryoem.bcm.edu/downloads/view_eman2_version/25|continuous builds]] and builds triggered from any other branch are uploaded to [[https://cryoem.bcm.edu/downloads/view_eman2_version/26|testing area]].
  1. Triggered by cron builds daily.
  1. Any branch in the form of "release-" triggers continuous builds without having to include "[ci build]" in the commit message. Once the release branch is ready, release binaries are manually copied from cont. builds folder into the release folder on the server.

 1. CI configurations files:
  1. [[https://circleci.com/gh/cryoem/eman2|CircleCI]]: [[https://github.com/cryoem/eman2/blob/master/.circleci/config.yml|.circleci/config.yml]]
  1. [[https://travis-ci.org/cryoem/eman2|TravisCI]]: [[https://github.com/cryoem/eman2/blob/master/.travis.yml|.travis.yml]]
  1. [[https://ci.appveyor.com/|Appveyor]]: [[https://github.com/cryoem/eman2/blob/master/appveyor.yml|appveyor.yml]]
  1. JenkinsCI: [[https://github.com/cryoem/eman2/blob/master/Jenkinsfile|Jenkinsfile]]
    1. Some env vars need to be set by agents:
      1. HOME_DIR, DEPLOY_PATH, PATH+EXTRA (to add miniconda to PATH).
      1. PATH+EXTRA is not set on win. (?)
    1. {{{
 Launch method: via SSH
   Advanced:
     Prefix Start Agent Command: "D: && "
}}}


= Docker Images =

 1. [[https://hub.docker.com/repository/docker/cryoem/centos6|CentOS6:]] Was used to build CentOS 6 binaries on CentOS 7 to provide EMAN binaries compatible on older Linux machines. Not needed anymore because we build with anaconda's compilers and bundle the runtime libraries.
 1. [[https://hub.docker.com/repository/docker/cryoem/jenkins|Jenkins:]] Customized Jenkins server to setup on our build machines.
 1. [[https://hub.docker.com/repository/docker/cryoem/eman-deps|CircleCI:]] Docker images to use on CircleCI as a replacement for CircleCI's cache.



= Under Construction =


= Jenkins Setup =
 1. Triggers
  1. GitHub webhooks
  1. Cron
  1. Binary build trigger

 1. Jenkins master needs PATH prepended with $CONDA_PREFIX/bin
 1. Jenkins Docker image, docker-coompose or docker stack deploy
 1. docker-compose.yml at home dir in build machines
 1. TZ: https://stackoverflow.com/a/46384925
 1. plugins
 1. config, jcasc, config.xml, users.xml, jobs/*.xml?, gpg encrypt
 1. Agent nodes setup, agent nodes auto-start
 1. Server and agent per machine vs single server and os agents
  1. Master only
  1. Master and agent per machine
  1. Single master and OS agents


== Linux ==
 1. systemctl

docker run -d -u root -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins:lts &

docker run -d -u root --name jenkins-master -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock -e PLUGINS_FORCE_UPGRADE=true -e TRY_UPGRADE_IF_NO_MARKER=true --restart unless-stopped cryoem/jenkins:dev

cron:

0 0 * * * bash /home/eman2/workspace/cronjobs/cleanup_harddisk.sh

$ cat Desktop/docker.txt docker run -p 8080:8080 -p 50000:50000 jenkins/jenkins:lts docker run -p 8080:8080 -p 50000:50000 --restart unless-stopped jenkins/jenkins:lts docker run -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home jenkins/jenkins:lts docker run -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /var/jenkins_home:/home/eman2/jenkins_home jenkins/jenkins:lts

# Working docker run -u root -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home jenkins/jenkins:lts docker run -u root -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home jenkins

docker run -d -u root -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins:lts

sudo docker run -it -v /var/jenkins_home:/home/eman2/jenkins_home jenkins

startup: right-click ???


== Mac ==
 1. plist

docker run -d --name jenkins-master -p 8080:8080 -p 50000:50000 -v /Users/eman/workspace/jenkins_home:/var/jenkins_home --restart unless-stopped jenkins/jenkins:lts

Auto startup: plist https://imega.club/2015/06/01/autostart-slave-jenkins-mac/ /Users/eman/Library/LaunchAgents

slave clock sync https://blog.shameerc.com/2017/03/quick-tip-fixing-time-drift-issue-on-docker-for-mac docker run --rm --privileged alpine hwclock -s

client 0 free swap space

$ cat Desktop/docker.txt docker run -p 8080:8080 -v /Users/eman/workspace/jenkins_home:/var/jenkins_home jenkins docker run -it -p 8080:8080 -v /Users/eman/workspace/jenkins_home:/var/jenkins_home --restart unless-stopped jenkins

# Working docker run -it -p 8080:8080 -v /Users/eman/workspace/jenkins_home:/var/jenkins_home --restart unless-stopped jenkins/jenkins:lts

# Blue Ocean docker run \

 . -u root \ --rm \ -d \ -p 8080:8080 \ -v jenkins-data:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \ jenkinsci/blueocean

# Latest docker run -d --name jenkins-master -p 8080:8080 -p 50000:50000 -v /Users/eman/workspace/jenkins_home:/var/jenkins_home --restart unless-stopped jenkins/jenkins:lts

FROM jenkins/jenkins:lts COPY plugins.txt /usr/share/jenkins/ref/plugins.txt RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

plugins.txt: ace-editor:latest bouncycastle-api:latest branch-api:latest chef-identity:latest

Settings: tokens slaves


== Windows ==
Move jenkins_home http://tech.nitoyon.com/en/blog/2014/02/25/jenkins-home-win/

Run as service: Open Task Manager(Ctrl+Shift+Esc), New task, Browse to agent.jnlp and run as admin does this work? This is when starting via Web Launcher doesn't work.

currently, task scheduler works need to have miniconda pn path, set it during miniconda installation, but do not(?) register python.

While installing miniconda register python and add to PATH. Then, conda init in cmd (git init cmd.exe) and git windows (git init bash). And, maybe restart???

BUG: miniconda3 conda-build=3.17.8 adds vc14 even if python2 is requested in build reqs

OPENGL: https://github.com/conda/conda-recipes/blob/master/qt5/notes.md

= Distribution =

== Binaries on cryoem.bcm.edu ==

== EMAN2 on anaconda.org ==

== EMAN2 Docker images ==

{{{#!wiki comment
= Build System Components =

digraph build_system_components {
    a [label = "Source code"]
    //=== CMake and Anaconda ===

    b [label = "Binaries"]
    //=== Test and CI ===
    d [label = "Test"]

    c [label = "Distribute"]
    c1 [label = "Package with Constructor"]
    c2 [label = "Conda recipe"]
    c3 [label = "Docker Image"]

    a -> b [ label = "CMake" ]
    b -> c
    b -> d -> c

    c -> c1
    c -> c2
    c -> c3

}


{{attachment:build_system_components.png}}
}}}






= Build System Notes =


== CMake ==

 1. ''libpython'' can be linked statically or dynamically when python is built. It is important for python extensions to be aware of the type of linking in order to avoid segfaults. This can be accomplished by querying Py_ENABLE_SHARED.

 {{{#!highlight bash
python -c "import sysconfig; print(sysconfig.get_config_var('Py_ENABLE_SHARED'))"
}}}

 In EMAN, it is done in [[https://github.com/cryoem/eman2/blob/master/cmake/FindPython.cmake#L29-L73|cmake/FindPython.cmake]]

 1. OpenGL detection when Anaconda's compilers are used is done using a [[https://github.com/cryoem/eman2/blob/master/recipe/cross-linux.cmake|cmake toolchain file]].

 1. glext.h file needed for OpenGL related module compilation is already present on Linux and Mac. On Windows, it is manually copied once into C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl. On Appveyor it is downloaded as part of env setup every time a test is run.


{{{{#!wiki comment

==== Docker ====
Docker images and helper scripts are at --(https://github.com/cryoem/docker-images )-- https://github.com/cryoem/build-scripts.

Command to run docker with GUI support, CentOS7: {{{
xhost + local:root

docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY cryoem/eman-nvidia-cuda8-centos7

# When done with eman
xhost - local:root
}}}

:FIXME: Runs as root on Linux. `chown` doesn't work, the resulting installer has root ownership.
}}}}

Binary Distribution

  • GitHub webhooks are setup to send notifications to blake. Blake forwards those to three build machines. Currently, webhooks are being listened to only on Linux. Linux runs the server that drives the Jenkins jobs.

Jenkins Setup

Jenkins server runs on Linux, Jenkins agents on Linux, Mac and Windows. The server instance manages Jenkins, the agents run the jobs.

  1. On Linux, to start Jenkins, run command:

    docker stop jenkins-master
    
    docker rm jenkins-master
    
    docker run -d -u root --name jenkins-master -p 8080:8080 -p 50000:50000 --restart unless-stopped -v /home/eman2/jenkins_home:/var/jenkins_home -e PLUGINS_FORCE_UPGRADE=true -e TRY_UPGRADE_IF_NO_MARKER=true --restart unless-stopped jenkins/jenkins:lts
  2. Server login info: 10.10.11.176:8080/ username: eman2
  3. Install Java on agents.
  4. Setup passwordless ssh connections from Linux server to agents.
  5. Binary builds require conda-build and constructor. Packaging is done with constructor, a tool for making installers from conda packages.

  6. Nodes: http://10.10.11.176:8080/computer/

    1. http://10.10.11.176:8080/computer/linux/configure

      1. name: linux
      2. remoteFS: /home/eman2/linux-1-agent/
      3. numExecutors: 100
      4. host: eman-centos7-01
      5. credentialsId: jenkins-key-eman2
      6. label: eman
      7. envVars
        1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
        2. HOME_DIR: /home/eman2
        3. PATH+EXTRA: /home/eman2/miniconda3/bin
    2. http://10.10.11.176:8080/computer/mac/configure

      1. name: mac
      2. remoteFS: /Users/eman/mac-1-agent
      3. numExecutors: 100
      4. host: eman-macmini
      5. credentialsId: jenkins-key-eman
      6. label: eman
      7. envVars
        1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
        2. HOME_DIR: /Users/eman/
        3. PATH+EXTRA: /Users/eman/miniconda3/bin
    3. http://10.10.11.176:8080/computer/win/configure

      1. name: win
      2. remoteFS: D:\workspace\win-1-agent
      3. numExecutors: 100
      4. host: BM-WIN-01
      5. credentialsId: jenkins-key-eman
      6. JavaPath: "D:\Downloads\openjdk-11+28_windows-x64_bin\jdk-11\bin\java.exe"

      7. Prefix Start Agent Command: "D: &&"

      8. label: eman
      9. envVars
        1. DEPLOY_PATH: /opt/web2py_apps/web2py/applications/cryoem/static/software/
        2. HOME_DIR: D:
        3. PATH+EXTRA: D:\Miniconda3;D:\Miniconda3\Scripts
      10. On Windows for sh calls in jenkins to work "Git for Windows" might need to be installed.

Jenkins Server Setup (on Linux)

  1. http://10.10.11.176:8080/manage/configure

    1. Labels: main master
    2. Jenkins URL: http://10.10.11.176:8080/

    3. System Admin e-mail address: eman-bot (linux)<eman.github@gmail.com>

    4. SSH Servers
      1. Name: Installer-Server
      2. Hostname: cryoem.bcm.edu
      3. Username: eman-binary-uploader
      4. Remote Directory: /opt/web2py_apps/web2py/applications/cryoem/static/software/
  2. http://10.10.11.176:8080/manage/configureSecurity/

    1. Agents
      1. TCP port for inbound agents
        1. Fixed: 50000
    2. Git Host Key Verification Configuration
      1. Host Key Verification Strategy
        1. Known hosts file
  3. Credentials: http://10.10.11.176:8080/manage/credentials/

    • ID                  Name
      gh-eman-bot         eman-bot (gh-eman-
      jenkins-key-eman    eman (jenkins-key-eman)
      jenkins-key-eman2   eman2 (jenkins-key-eman2)
  4. Jobs
    1. http://10.10.11.176:8080/job/cryoem-eman2-trigger/: Triggers job cryoem-eman2 on agents

    2. http://10.10.11.176:8080/job/cryoem-eman2/: Test(?) and binary builds

    3. eman-dev(?): Triggers new build of eman-dev
    4. http://10.10.11.176:8080/job/eman-bump-version/

    5. http://10.10.11.176:8080/job/eman-feedstock-update-version/

    6. http://10.10.11.176:8080/job/eman-feedstock-trigger-from-eman-master/

    7. http://10.10.11.176:8080/job/build-binary/

    8. http://10.10.11.176:8080/job/build-binary-trigger/

    9. http://10.10.11.176:8080/job/eman-feedstock-building-eman-v2.99/

  5. JenkinsCI: Jenkinsfile

    1. Secrets like ssh keys are stored locally in Jenkins
    2. Manually triggered by including "[ci build]" anywhere in the last commit message. Manually triggered builds on master branch are uploaded as continuous builds and builds triggered from any other branch are uploaded to testing area.

    3. Any branch in the form of "release-" triggers continuous builds without having to include "[ci build]" in the commit message. Once the release branch is ready, release binaries are manually copied from cont. builds folder into the release folder on the server.

Anaconda

Dependencies not available on anaconda or conda-forge are available on cryoem. The binaries are built and uploaded using conda-forge's conda-smithy. conda-smithy takes care of generating feedstocks, registering them on GitHub and online CI services and building conda recipes.

  1. conda is the package manager.

  2. https://anaconda.org is the online repository of binaries.

  3. conda-build is the tool to build from source.

  4. constructor is the tool to package eman2 and dependency binaries into a single installer file.

EMAN2 is distributed as a single installer which includes all its dependencies.

Conda

Packages that are available on https://anaconda.org can be installed into any conda environment by issuing the command conda install <package>. Conda installs the package along with its dependencies. In order for packages to benefit from this automation, they need to be packaged in a specific way. That can be done with conda-build. conda-build builds packages according to instructions provided in a recipe. A recipe consists of a file with package metadata, meta.yaml, and any other necessary resources like build scripts, (build.sh, bld.bat), patches and so on.

Recipes, Feedstocks and anaconda.org channel: cryoem

Most of EMAN2 dependencies can be found on anaconda's channels, defaults and conda-forge. A few that do not exist or need to be customized have been built and uploaded to channel cryoem. The recipes are hosted in separate repositories on GitHub. Every recipe repository follows the feedstock approach of conda-forge. See here for a complete list.

Feedstocks

General instructions

  1. Existing feedstocks
  2. Files to edit: recipe/, conda-build.yaml, conda-forge.yaml
  3. conda create -n smithy conda-smithy -c conda-forge
  4. conda-smithy rerender
  5. More info in conda-smithy/README.md, conda smithy -h, conda-forge.org/docs
  6. New feedstocks
  7. conda-smithy/README.md, conda smithy -h

Conda-smithy Workflow

Conda smithy uses tokens to authenticate with GitHub.

Conda-smithy commands:

  •    1 conda create -n smithy conda-smithy
       2 conda activate smithy
       3 conda smithy init <recipe_directory>
       4 conda smithy register-github <feedstock_directory> --organization cryoem
       5 conda smithy register-ci --organization cryoem --without-azure --without-drone
       6 conda smithy rerender --no-check-uptodate
    

Build System Notes

CMake

  1. libpython can be linked statically or dynamically when python is built. It is important for python extensions to be aware of the type of linking in order to avoid segfaults. This can be accomplished by querying Py_ENABLE_SHARED.

       1 python -c "import sysconfig; print(sysconfig.get_config_var('Py_ENABLE_SHARED'))"
    

    In EMAN, it is done in cmake/FindPython.cmake

  2. OpenGL detection when Anaconda's compilers are used is done using a cmake toolchain file.

  3. glext.h file needed for OpenGL related module compilation is already present on Linux and Mac. On Windows, it is manually copied once into C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl. On Appveyor it is downloaded as part of env setup every time a test is run.

EMAN2/BuildSystem (last edited 2022-12-12 03:42:44 by TunayDurmaz)