How to traverse through the pid namespace of a container? - linux-containers

I've to traverse through the process tree of the container launched in runc container environment.
My goal is to walk the process tree when the container is paused and call clone method to specific pid of that process tree so that it creates a new child process to it. How can i acheive this?

Related

Teamcity + NUnit - exclude assembly from dll

Currently, I am working with a new set of unit tests in my project.
Let's say that on TeamCity I have a build that goes at night and one that goes after every commit.
In both, I have one same build step.
It is a NUnit runner which run tests from three dll files.
In one of them I have my new tests which are located in the same directory (same namespace).
I would like my tests not to run on this build, which moves all the time.
I know that NUnit command line allows excluding categories. Unfortunately, my tests are generated using specflow and it is not effective to add a category to all scenarios.
Is it possible to exclude tests with specified namespace?
Yes. Use option `--where "test!=some.name.space"

What is the best directory structure for building multiple Polymer components?

I'm building multiple polymer components to be used across multiple projects. They each have their own git repo. Some of them are dependencies of others. Currently I have each one cloned into a "components" directory. This is problematic though. If I run bower install so I can access a functioning demo page without committing, pushing, and bower-updating, other components like Polymer/paper-button are installed at the same level per the .bowerrc file. I then have source and consumption component directories intermingled. Also, my own components are re-fetched from github (perhaps only sometimes?) and overwrite the directory that contained the .git directory.
What is the best way to organize my components and still be able to access the demo page as I make changes?
I'd recommend following the guidelines outlined at the start of https://www.polymer-project.org/docs/start/reusableelements.html for each of your individual elements.
I.e. for each element you're developing, create a fresh top level directory, then place your clone of <seed-element> into that, and use the .bowerrc that comes with <seed-element> and specifies "directory": "../".
List each element's dependencies in each element's bower.json and pull them in directly from GitHub. If you're working on your <element-one> and it depends on some updates to your <element-two> that you can't yet push out to GitHub, then I don't see a problem with just temporarily overwriting the bower-installed version with a local copy of your in-progress <element-two> code.

Perforce Streams: Selective Copy up to Main

We utilize streams to manage our code in Perforce. We are having issues when efforts are moved out to later releases as part of our controls requires that we have a valid/approved artifact tied to a release before we copy up to the main stream and proceed to cut the release stream.
In Perforce when you are copying code up from a development stream to the main stream is there a way to deselect change lists? When I attempt it, it appears I can deselect specific change lists, usually the last few added, but Perforce seems to not allow certain lists to be deselected, I am guessing if the file changes are included in later changes to the same file.
Is there a good way to selectively move these change sets?
You'll want to use the merge command instead of copy in this case to cherry pick the changes up to main. Copy takes files at a point in time and makes the target look like the source no matter what. Merge will let you pick around changes that aren't ready.

Perforce like client specs mappings with Mercurial

We recently moved from Perforce to Mercurial and love it!
One little problem: after much research we can't figure out how to map a special directory in the repository to some special place on the client. Here is an example of our hg repo:
/foo/source files
/bar/source files
/build
/macosx/mac make files
/win/windows make files
With Perforce, we were using client spec mappings to map //depot/build/macosx/... to just /build/... on the Mac client, and //depot/build/win/... to /build/... on the Windows dev box. Directories foo and bar are synced as is. Makefiles in /foo and /bar assume that our build makefiles are located in /build and we would like to keep them as is. The final client set of files should look like this:
/foo/source files
/bar/source files
/build/client specific make files
I've read about subrepos, but this solution does not seem to be client specific.
Any idea how to solve this problem will be very much appreciated!
You can't check out only portions of a repository with Mercurial.
You always get a clone containing everything, and the working directory will also contain everything.
With Mercurial you should strive to have 1 repository for 1 project, so that everything you get logically belongs together, and then you shouldn't have much need for just a portion of it.
This also means that whatever directory structure you have in your Mercurial repository will always match exactly the structure you have on disk.
You can't do this with Mercurial as it doesn't have the concept of a client separate from a depot.
However, you can use a symlink on Mac OS X (ln -s) and a junction on windows (mklink on Vista and up using the junction tool on XP http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) to solve this problem on the file system level.
Alternatively you can use a variable in the Makefiles to refer to the build directory (eg $(BUILD)/something.ext instead of build/something.ext).
This sort of mapping cannot be done in Mercurial. There is an outstanding TODO item for 'narrow' clones so you can check out just a subdirectory. And I could see an implementation of that supporting that sort of functionality. But then again, I know that something like this would be considered a little too 'clever' (read complex) and there would be a lot of push-back on the idea.
In the meantime, I would suggest one of these two solutions.
Symbolic links. Put the symbolic link to your build directory in your .hgignore file. Then each person can make their own symbolic link to the appropriate directory of build files. This has the disadvantage of not working on a platform without symbolic links.
An environment variable that's used in a top level makefile to construct the path to the platform specific makefile it should be calling.

Flash AS3 with HG version number?

I'm using ant, hg, and the linux Flash as3 libraries to compile. I would like to include some sort of version info automatically, for debugging purposes.
No matter what you're using for version control, remember that the key thing here is that you need the commit id before compiling the swf, that's what makes it tricky.
Using HG hooks (or whatever the equivalent from SVN is called in HG) you have to first commit your code, get the commit id, then write that info to one of the .as files and finally call Ant to compile the SWF.
The problem would be if you want to keep that SWF under version control too. Because even if your Ant task could somehow inject the info directly into the SWF, it would appear as modified (it has been updated after the commit).
In JS / HTML / PHP / whatever this is so much simpler because there's no compiling.
I still need to fully figure this one out, I've only partially done it in the past, so I'm all ears for a complete solution.
I am not familiar with ant, but the simplest and most reliable process is to dynamically create a file and put the result of hg id or hg parents somewhere in it.
For example mercurial does this in setup.py, maybe it will help you do a similar thing. version is taken from the result of calling hg id -i -t.
f = open("mercurial/__version__.py", "w")
f.write('# this file is autogenerated by setup.py\n')
f.write('version = "%s"\n' % version)
f.close()