OpenShift Cloud Computing: Advanced installation - docker

I want to install OpenShift using the advanced installation - method on Centos7 (EC2). But first I need to know some issues:
URL of tutorial: https://docs.openshift.com/enterprise/3.0/admin_guide/install/advanced_install.html#installing-ansible
First I need to configure the prerequisitions on the master and its 2 nodes (https://docs.openshift.org/latest/install_config/install/prerequisites.html).
When that's done the advanced installation will start.
1) Do I have to install ansible on the master only and running the installer at the end or do I need to install anything on the node (except docker)?
2) Which steps do I have to follow here: https://github.com/openshift/openshift-ansible or just download the repo and following the tutorial.
3) Is there something necessary what needs to be installed or configured which is not cited?

You are correct to start with the prerequisite steps outlined in the origin documentation.
In particular,
Ensure that you've completed host preparation steps. These steps include packages that must be installed on every system.
Ensure that you've configured host access. The ansible installer uses ssh key authentication by default so you must be able to login to each system (including the master) from the master with ssh key authentication.
Ensure that the output of hostname -f outputs the correct hostname of each system.
Once you've finished with the prerequisite steps, you will move on to the advanced installation section. Steps for installing ansible and creating an ansible host inventory can be found here. You only need to install ansible on the master. Once you've installed ansible and created a host inventory you can run the ansible playbook to begin the installation.
Afterwards, you can verify the installation and then complete follow up items such as configuring authentication, creating a router and creating a docker registry.
If you encounter any problems with the advanced installer, create an issue with the openshift-ansible project.

Related

How to start docker containers using shell commands in Jenkins

I'm trying to start two containers (each with different image) using Jenkins shell commands. I tried installing docker extension in Jenkins and/or setting docker in global configuration tools. I am also doing all this in a pipeline. After executing docker run... I'm getting Docker: not found error in Jenkins console output.
I am also having a hard time finding a guide on the internet that describes exactly what I wish to accomplish. If it is of any importance, I'm trying to start a Selenium Grid and a Selenium Chrome Node and then using maven (that is configured and works correctly) send a test suite on that node.
If u have any experience with something similiar to what I wish to accomplish, please share your thoughts as what the best approach is to this situation.
Cheers.
That's because docker images that you probably create within your pipeline cannot also run (become containers) within the pipeline environment, because that environment isn't designed to also host applications.
You need to find a hosting provider for your docker images (e.g. Azure or GCP). Once you set up the hosting part, you need to add a step to your pipeline to upload/push the image to that provider's docker registry or to the free public Docker Hub. Then, finally, add a step to your pipeline to send a command to your hosting, to download the image from whichever docker registry you chose, and to launch the image into a container (this last part of download and launch is covered by docker run). Only at that point you have a running app.
Good luck.
Somewhat relevant (maybe it'll help you understand how some of those things work):
Command docker build is comparable to the proces of producing an installer package such as MSI.
Docker image is comparable to an installation package (e.g. MSI).
Command docker run is comparable to running an installer package with the goal of installing an app. So, using same analogy, running an MSI installs an app.
Container is comparable to installed application. Just like an app, docker container can run or be in stopped state. This depends on the environment, which I referred to as "hosting" above.
Just like you can build an MSI package on one machine and run it on other machines, you build docker images on one machine (pipeline host, in your case), but you need to host them in environments that support that.

Update jenkins war on one machine and then move it to another one: possible?

I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:

Cloudbees Jenkins job cannot install packages via Yum

I have Jenkins running on a Cloudbees Fedora 17 node. I need my job to be able to install certain packages to build my project correctly for deployment but my yum install commands fail because the jenkins user does not have the correct permissions.
I cannot SSH into the box or use the jenkins CLI to assign root permissions to use sudo and Cloudbees doesn't appear to enable the Script Console. Neither can I run the yum command as with su because it expects the administrator password which I cannot enter remotely.
What can I do?
I am not aware that you can install additional software on the CloudBees Jenkins master node. But you can request from CloudBees support that additional software packages will be installed on the automatically created CloudBees build nodes.
As alternative you can also create your own build nodes (called OPE in CloudBees). This is helpful for a lot of cases such as specific software requirements (such as closed source software which requires a license) or just to be much more flexible when it comes to require packages installed on it.
Since you didn't mention what kind of packages are missing: There are a lot of frameworks that provide much more ruby, java, python, go etc. versions as any Linux distribution. CloudBees provides documentation for a lot of them on http://dev-at-cloud-docs.cloudbees.com/docs/dev-at-cloud-docs-1.1/Build+Tools.html
This is the problem with hosted solutions like what Cloudbees offers. If you need access to operating system level permissions on the host server, then you have little choice but to host Jenkins yourself, or to obtain a different licensing structure with CloudBees in order to have a VPS, or some other isolated but still SaaS hosted solution.

Is there a way to install the ios-universal-framework on a cloudbees spawned Jenkins slave?

Using a Master Jenkins on premises, and the cloudbees plugin, I am able to kick off iOS builds to a cloud bees instance. It's pretty sweet.
My IOS developers require cloning the ios-universal-framework repo, and then running an install.sh script contained within that repo. Everything works fine until the script issues a "sudo" command to copy files into the directory
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications"
The cp command needs sudo privileges. I'm thinking this is not possible but since I'm on the free trial plan, this is where I can find support. Thanks to all for reading.
Tony

Jenkins runs as root instead of Jenkins

I have a newly installed jenkins server running on my computer, and am having some issues related to permissions.
It seems that jenkins creates the workspace directory as the root user, and then of course all task (including even pulling from the repository) fail, because they do not have permissions to modify the directory
Have a look at the Started-By Environment Variable plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Started-By+Environment+Variable+Plugin
If you are just asking how to set up Jenkins to run under a different user in Linux it depends on how you installed it. Have a look at https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins for different setup options. I had a look at Installing Jenkins as a Unix daemon and at step 7 you need to setup a configuration file. Change the last line in that file (RUN_AS_USER=jenkins) to contain the user of your choice.

Resources