How do I make Drone OSS build anything? - cicd

I have built the Drone OSS using instructions at https://github.com/harness/drone/blob/master/BUILDING_OSS and successfully connected it to GitHub, it is triggering builds and I can log-in to the UI.
However, nothing happens after a build is triggered, the pipeline is stuck in Loading... and step does not execute.
Now this is not my first rodeo with Drone, I have the enterprise one running just fine, with runners connected and builds running fine. So I am relatively certain I don't have setup issues.
It is my understanding the OSS one does not support runners, and sure enough when runners try to connect to it they get 404 on the API endpoints they are trying to connect to.
So the question then is, how does one actually build anything with Drone OSS? what pipeline syntax / config must one use?
I am at a loss.

Solution: Start server with DRONE_AGENTS_DISABLED=true
Source: https://community.harness.io/t/drone-community-not-running-builds/11024/5

Related

ChromeOS errors in GCP Logging

I'm seeing errors in StackDriver logging for my Compute instance. The logs are showing repeated issues every hour, creating a lot of noise. I have a Spring Boot API deployed in a container to a VM in Compute Engine using latest stable version of Container OS.
I'm relatively new to GCP and don't understand what is causing this issue, searches have come up empty so far.
Failed to call method: org.chromium.SessionManagerInterface.RetrieveActiveSessions: object_path= /org/chromium/SessionManager: org.freedesktop.DBus.Error.ServiceUnknown: The name org.chromium.SessionManager was not provided by any .service files
CallMethodAndBlockWithTimeout(...): Domain=dbus, Code=org.freedesktop.DBus.Error.ServiceUnknown, Message=The name org.chromium.SessionManager was not provided by any .service file
Error calling D-Bus proxy call to interface '/org/chromium/SessionManager': The name org.chromium.SessionManager was not provided by any .service files
The same 3 lines are repeating every hour. Anyone aware of what might be causing this or how to fix/suppress these?
I looked into this error, and as per my findings:
The error message that you have been receiving is a manifestation of Chrome to reliably exit shortly after starting up.
The UI’s job (which encompasses Chrome, the session_manager and the window manager) gets shut down by upstart because of it's thrashing, and when the test tries to restart the session_manager, the session_manager cannot communicate it over to the D-Bus.
The crash collection software in Container OS was originally for Chromebooks (The laptop using Chrome browser). So the code typically expects Chrome and some other related software on the system.
However, Container OS is a server OS, and does not have Chrome. So if Chrome is missing, the software will report some errors. They are actually not real failures, just some verbose error messages.
Overall, It is safe to ignore these logs and continue using your VM Instances.
Hope this helps.

With QtCreator, how can I build my project on a remote server I have ssh access to?

I need to build an application on a remote server so it can be run locally, where it will issue commands to a website it is hosting. I'm building this application on my machine in QtCreator, but I would like to streamline testing the application by having it build on the remote server.
What is the best way to go about this?
That first sentence is so long and so confusing... -_-
That said Qt Creator supports remote deploying and debugging but not remote building (as far as I know; please someone correct me if I'm wrong).
The only remote-related thing about the building step is cross-compilation which again is performed locally (using a cross-compiler, specifying the sysroot etc.). Of course if the target platform is the same (architecture and installation wise) as the one you use for development the cross-compilation chaos can be completely omitted.
If you want to build Qt-based application (and not only run it) on the remote platform, you will have to setup the development infrastructure (Qt dev libraries, qmake etc.). However, I would suggest using your local system for the development unless the server provides a very noticeable boost during the building step. It's easier that way and makes sense especially if the application that you are building on the remote will be executed locally.
you have 3 options really:
run the IDE on the remote server and connect using vnc or x2go. This requires a relatively high bandwidth/low latency connection, or the GUI won't be reponsive. This is personally what I do at my work - although we have a dev server set up to mirror prod in our building - so the data connection is great.
sync your files using lsyncd and build via commandline. You code-completion will be based on your local machine, so won't be perfect, and you wont be able to double click compile errors, etc. If you are brave you could maybe set up a qt creator build configuration to do this for you, but includes would still be broken.
use another IDE. NetBeans supports remote builds. I have never personally used this feature, but I've heard that it works ok.

Calabash how to speed up execution time

I have a Android device connected to my PC.
Running a calabash test I use the following command:
calabash-android run <NAME>.apk features/<NAME>.feature
Now before running a feature Calabash always uploads the application again witch takes time.
How can I disable this?
Any help would be appreciated!
Thank you!
You can control the reinstallation of the app using the hooks file. This contains the cucumber hooks for before and after scenario. If you didn't make the hooks file that you are running then it's probably one from a sample project.
The bit you're looking for is the 'reinstall_apps' command. If you remove it completely then your app won't ever be reinstalled, which can be a bad thing as it's sometimes necessary to reset the app completely. The way I handle it is to tag the features where I do want the app reinstalled with #reinstall_app and then
Before do |scenario|
puts "Starting scenario - #{scenario.name}"
reinstall_app if scenario.source_tag_names.include?('#reinstall_app'))
...
end

Realtime server push with Socket IO (or Strophe.js), XMPP and Django

I have a couple of Android and iOS native mobile application that I wrote which connect directly to an XMPP server that I host. They push and pull realtime data through XMPP. I also use some of the XMPP XEP extensions. For other operations, I have a django application running on the same server which all the mobile applications consume through an HTTP REST interface. I use Celery and Redis for the django side to do some operations asynchronously (like doing heavy batched writes to my db).
This all works fine and dandy. Yay.
But now I want to write a web front-end to all of this, so I started researching my options and well - there are so many ways to skin the cat that I wanted to check with the SO community first.
The idea to have a js library that gives me a unified API for socket communications (i.e try different implementations of web sockets or fall back to flash) appeals to me hence why I mention Socket IO. The idea of having to run a nodejs server, well, not so much (one more thing to learn), but if I have to, I definitely will. I know that some people use gevent as a replacement of the node server. Others, decide to write a small nodejs which they connect to the rest of their stack. I would probably do this.
Another option, is to use an js XMPP library like Strophe which I don't think has a flash fallback. Also, I would need to research what this means for my server.
I have read several of the Stackoverflow answer on how to do comet and django - hence why it seems that there are several options.
The question is:
If I want to have the advantage of Socket IO behavior (with the fallbacks) and I want to push realtime data to the web client (which is being fed to the server through XMPP), and use Django what is my best option?
Update: The XMPP server that I use is ejabberd, which also supports BOSH. I realize that I could use Strophe.js and thus my communication would go over a type of long polling http connection instead of websockets. As far as I can tell, there are some XMPP over Websockets open source library, but AFAIK the community is not as active as the SocketIO one.
Update 2: Browsers that I need to support are only modern browsers. I guess this means that Flash fallback will not be that important, which is leaning me towards strophe.js.
I think once you get your hands dirty with some node you'll find that straying from Node for socket.io is going to be much harder. There are very easy to use xmpp modules in node ready to go (see https://github.com/astro/node-xmpp). Remember, node is all javascript, so you're probably familiar with programming in it already.
Personally, I've had some memory leak issues using node 0.6 or higher. Node 0.4 worked without those issues. If you are new to github (as I was before playing with Node) here is how you would get going with a node server.
Getting Node
Login to your linux box and favorite directory (I'll assume /)
git clone https://github.com/joyent/node.git
cd /node
git tag -l (this will list all available version of node)
git checkout v0.6.16 (this will checkout 0.6.16 version of node, you could replace that with v0.4.12 for example if you have memory issues)
./configure
make
make install
You'll need certain development tools to build it such as g++, but at this point you'll have a working node command.
Installing Node Modules like xmpp
Node has a nice amount of modules where most things have already been written for you. There is a search facility at http://search.npmjs.org or you can access all modules directly from your shell by using the npm command. NPM is nodes tool for installing and managing node modules. You can type npm search xmpp to search for all xmpp modules, for instance. To install a basic xmpp library for node you would do npm install node-xmpp. By the way, most github node module pages will include instructions on the front page readme file.
Keeping Node Running in Production
This threw me when I first started out. If you have any errors that are not caught node will simply die. So, you can either
1. Make sure there are no errors whatsoever or they are all caught (unlikely because even Node itself will error)
2. Use the uncaughtException handler to catch these problems. You would use code like this in your program
process.addListener("uncaughtException", function (err) {
util.log("Uncaught exception: " + err);
console.log(err.stack);
console.log(typeof(this));
// maybe email me?
});
Be Extra Safe and Use Forever
Even with the uncaughtException issue your program in production might die. Memory running out, segfaults, who knows what. That's where it pays to use something like the wonderful Node module called "Forever" (see https://github.com/nodejitsu/forever). You can type npm install forever -g to install forever. Note the -g option which puts forever in the GLOBAL node module directory. Without -g it puts the node module in the current working directory. You'll then be able to type something like (assuming your node program was called my_program.js) forever start my_program.js and then the Forever program will make sure that if it dies it gets restarted.
Not sure why you'd need Flash fallback if you're going to do BOSH (XEP-0124, XEP-0206), which is what strophe.js does. If you don't need to support IE7, you can do CORS from strophe.js, and you don't even need a proxy for same-origin. IE6 will work because it's insecure, and IE8+ support a just-barely-working form of CORS.
To get information from django through XMPP to your client, make a component connection (XEP-0114) to your server using your favorite Python XMPP library, such as SleekXMPP from your Django app. Arrange for that connection to be relatively long-lived, for performance (i.e. don't create a new one for each client connection). Send protocol as needed.
You didn't mention what XMPP server you're using. XMPP servers that don't support BOSH are getting rare, but if you've got one, you might need Punjab as a BOSH-to-XMPP proxy, or you might want to switch to a newer server, such as Prosody.
First of all, full disclosure: I work for a company called PubNub, which I'm going to mention shortly.
There are a whole range of hosted bidirectional messaging services (sometimes called IaaS - Infrastructure as a Service) that I think are worth considering. They are Pusher, Firebase, Flotype, PubNub, and others. I'm reasonably confident you could use any of them for what you want to accomplish. Firebase has a built-in database that ties right into their service, which is a pretty cool feature, but probably not useful for your particular use case (I assume you already have a database on your backend).
I can't speak too heavily about our competitors, but as far as you wanting a JavaScript library on the frontend that communicates with your Python backend, we (PubNub) provide a very similar api in both languages and that communicate on the same databus in the cloud. So you can send messages with Python and catch them with JavaScript, or vice-versa. We even wrote a PubNub-hosted version of socket.io, which you could use instead of our vanilla JavaScript api, and would still tie into your Django backend in about 10 lines of code.
Finally, the nice thing about using an IaaS (or at least us; again I'm not certain about the others) is that we handle that tricky scaling problem for you. If you reach the point of a million simultaneous users and need to push something to them in real-time, you'll find that's no problem.
We are using real-time push as well with Django and Celery. When I first created the architecture, I also researched my options. Eventually, I decided that I'd rather focus on getting the app just right rather then on fiddling around with devops work. There are several services out there that offer hosted real-time push technology that can be easily integrated with any app.
I chose PubNub and I couldn't be happier. They support socket.io for the client side and have a Python lib I use from Django and Celery workers. They also have SDKs you could use from native mobile apps.
I know, you already have a working setup in place. But I'm betting that the time it will take you to replace your current setup with such a hosted solution would be less than the time it will take you to find a good solution for what you're looking for and implement it. Also keep in mind maintenance costs down the road (esp if you opt for a lib which is not well maintained).
True, you will be paying for the service, but they price is very reasonable and you will be getting a solid service with nice perks like colocation.
I'm not affiliated with that company, just a happy customer. There are other similar services out there.

CruiseControl.NET run as a windows service and as a standalone process behaves differently

I have a project that is being built using CruiseControl.NET. The project contains an 'MSBuild task' that runs the build for the project and also the unit tests. The unit test in turn is just a MSBuild 'exec' task that runs an executable.
The unit test involves some .NET remoting. And when the unit tests are run through the system command prompt, the software's window opens up, tests run and the process exits.
When I force a build through the web dashboard, the build hangs at the point where the unit test starts running. The software's window does not open up, but the executable is running. If the process is killed through the task explorer, the build goes through with a 'Failure' status. This happens when I run ccnet as a windows service.
If I run CCNet directly (not as a windows service) and force a build through the web dashboard, the build and unit tests go through fine as expected. (with the window of the software opening up.)
It looks like there is a deadlock in the case where CCNet is run as a windows service. I am guessing it is related to the standard output/error streams.
Is this is known problem?
What might be the problem going on?
Any suggestions on debugging this?
How can I get around it?
(I am using CCNet version 1.4.4 SP1)
When CCNet is running as a service it is not going to have access to the display, so don't expect to see anything on the screen in this configuration. The first thing I would check is the permissions - make sure the service runs as an account that has permissions to access whatever resources you need. You also have CCNet log files, which you can find via Dashboard.
On a side note, try TeamCity instead of CCNet, its 10 years ahead.
Maybe this answer will help :
delphi windows service can't download file from internet
You should know that when running CCNet as an application (the dosbox) it uses the environment variables and all rights from the logged account. So it may connect to a server, use cached passwords, get registry variables for this account.
BUT when ran as a service, the account is the one you provided : LocalSystem for exampe, where env. varibales are not the same.
So, what you can do is to change the CCNet service account for test. Change it to your user account (with password), and I'm sure it will work better !