Differences between revisions 27 and 28
Revision 27 as of 2022-06-29 20:33:16
Size: 11856
Editor: TunayDurmaz
Comment:
Revision 28 as of 2022-06-29 20:39:02
Size: 11940
Editor: TunayDurmaz
Comment:
Deletions are marked like this. Additions are marked like this.
Line 141: Line 141:
  1. Triggered by cron builds daily.   1. --(Triggered by cron builds daily.)--
Line 145: Line 145:
  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. --([[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]])--
Line 149: Line 149:
    1. Secrets like ssh keys are stored locally in Jenkins

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

eman2: https://img.shields.io/github/v/release/cryoem/eman2.svg eman2: https://img.shields.io/github/v/tag/cryoem/eman2.svg eman-deps: https://img.shields.io/github/v/tag/cryoem/eman-deps-feedstock.svg

  1. b1
  2.  <details>
     <summary>
      long detailed
     </summary>
     bbb
     </details>
  3. b3

No list

CMake

  1. Dependency binaries are pulled from Anaconda. CMake uses conda environment location to find packages.
  2. 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
    ... .....
    ... .....
  3. 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

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

  5. 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.
  6. Compiler warnings are turned off by default and can be turned on by setting ENABLE_WARNINGS=ON
       1 cmake <source-dir> -DENABLE_WARNINGS=ON
    
  7. 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 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.

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

Initial Setup

Maintenance

Conda-smithy Workflow

Conda smithy uses tokens to authenticate with GitHub.

  •    1 # conda-forge.yml
       2 
       3 channels:
       4   sources: [cryoem, defaults, conda-forge]
       5   targets:
       6   - [cryoem, main]
       7 
       8 github:
       9   user_or_org: cryoem
      10   repo_name: <package>-feedstock
      11 
      12 provider:
      13   linux: circle
      14   osx: travis
      15   win: appveyor
      16 
      17 azure:
      18   build_id: blank
    
       1 # recipe/conda_build_config.yaml
       2 
       3 channel_sources:
       4 - cryoem, defaults,conda-forge
       5 channel_targets:
       6 - cryoem dev
    

Conda-smithy commands:

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

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. GitHub token needed for commit status ?

  2. Every time a commit is pushed, source installation and binary builds are tested.
  3. 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 continuous builds and builds triggered from any other branch are uploaded to testing area.

    2. Triggered by cron builds daily.

    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.
  4. CI configurations files:
    1. CircleCI: .circleci/config.yml

    2. TravisCI: .travis.yml

    3. Appveyor: appveyor.yml

    4. JenkinsCI: Jenkinsfile

      1. Secrets like ssh keys are stored locally in Jenkins
      2. Some env vars need to be set by agents:
        1. HOME_DIR, DEPLOY_PATH, PATH+EXTRA (to add miniconda to PATH).
        2. PATH+EXTRA is not set on win. (?)
          1. Now, it is set on win, too.
      3.  Launch method: via SSH
           Advanced:
             Prefix Start Agent Command: "D: && "
      4. On windows for sh calls in jenkins to work "Git for Windows" might need to be installed.

Docker Images

  1. 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.

  2. Jenkins: Customized Jenkins server to setup on our build machines.

  3. CircleCI: Docker images to use on CircleCI as a replacement for CircleCI's cache.

Under Construction

Jenkins Setup

  1. Triggers
    1. GitHub webhooks

    2. Cron
    3. Binary build trigger
  2. Jenkins master needs PATH prepended with $CONDA_PREFIX/bin
  3. Jenkins Docker image, docker-coompose or docker stack deploy
  4. docker-compose.yml at home dir in build machines
  5. TZ: https://stackoverflow.com/a/46384925

  6. plugins
  7. config, jcasc, config.xml, users.xml, jobs/*.xml?, gpg encrypt
  8. Agent nodes setup, agent nodes auto-start
  9. Server and agent per machine vs single server and os agents
    1. Master only
    2. Master and agent per machine
    3. 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

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