Uncategorized

Moving Azure Items Between Subscriptions

I have been using Azure Free Trial subscription before I got my BizSpark account. Because the subscription was ready after the trial expired, all trial items have been blocked, but still visible in Azure (see Figure 1).

azure
Figure 1: Azure portal

I thought that I only change the subscriptions of the items to the BizSpark. But only possibility is to remove. So after arguing and googling I tried to contact Azure support page.

  1. Go the support page
  2. Select “Get support” (Figure 2)

    azure
    Figure 2: Azure support portal
  3. Fill ticket information (Figure 3)

    azure
    Figure 3: Ticket Information
  4. Select “Subscription and Migration” and press “Continue” (Figure 4)

    azure
    Figure 4: Type Selection
  5. Specify Category to “Transfer data to different subscription” (Figure 5) and press “Continue”

    Figure 5: Specify Category
    Figure 5: Specify Category

Next day, a guy from Azure Support called me that there is a problem with my subscriptions. Because I was “too fast” and I have already created new items in BizSpark subscription, the migration is not possible – target subscription must be clear. to be more specific, there are some preconditions which must be satisfied before migration (taken from email from Azure Support):

  • We do not support selective service transfer; transfer only a selected hosted service, storage service from one subscription to another. This may become available in future but today, we must transfer all services or none.
  • The source as well as destination subscription must be active.
  • The destination subscription must be completely empty. (We do have separate process to migrate to a subscription with services running, however it requires more time.)
  • The source and destination subscriptions must have the same service administrator until the migration is complete.
  • The source and destination subscription cannot contain deployments/affinity groups with the same name.
  • There are some services that we cannot migrate and other services you will migrate yourself.  Please see the table below.
Azure can move: You must move: Unable to move:
Virtual Machines VSO Cache
Cloud Services SQL DB BizTalk Services
Web Sites Active Directory HD Insight
Media Services   Backup
Storage   Hyper-V Recovery Manager
Multi Factor Authentication   Azure Store
Traffic Manager   Import / Export
Mobile Services   Scheduler
Virtual Network   Management Services
Access Control Service (ACS)   Azure Automation
Reserved IP Address + Reserved IPs under the list    
CDN    

So I have deleted all new items in the new subscription and replied to Azure Support that the migration can be proceed, even Force (it is also possible, but must be proceed by another Azure Support Team, so it takes time).

So still waiting, hope that tommorrow it will be proceeded :)…

Uncategorized

Establishing Python CI Build in Jenkins

Setting up project build in Jenkins is very easy – there are a lot of plugins fow varioous languages, notification, pre and post build actions. But the most important path is Build Action itself.

Build Action for Python Project Build with Unit Test and Code Analysis

PYENV_HOME=$WORKSPACE/.pyenv/

# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
    rm -rf $PYENV_HOME
fi

# Create virtualenv and install necessary packages
virtualenv --no-site-packages $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet -r requirements.txt 
pip install --quiet nosexcover
pip install --quiet pylint
nosetests --with-xunit --cover-package=myapp --cover-erase --with-xcoverage ./test 
pylint -f parseable myapp/ | tee pylint.out

Build Action for Python Module Build with Unit Test and Code Analysis

PYENV_HOME=$WORKSPACE/.pyenv/

# Delete previously built virtualenv
if [ -d $PYENV_HOME ]; then
    rm -rf $PYENV_HOME
fi

# Create virtualenv and install necessary packages
virtualenv --no-site-packages $PYENV_HOME
. $PYENV_HOME/bin/activate
pip install --quiet nosexcover
pip install --quiet pylint
pip install --quiet $WORKSPACE/  # where your setup.py lives
nosetests --with-xunit --cover-package=myapp --cover-erase --with-xcoverage ./tests
pylint -f parseable myapp/ | tee pylint.out

Post-Build Actions for Both Configurations

**/nosetests.xml
Uncategorized

Selection of Appropriate Continuous Integration Solution for the Projects

CI service providing builds, tests and deployment is must when you want to speedup your work and get rid of useless work. There exist various solutions these days. All of them do almost same, but not every with same requirements.

We had following needs:

  • Easy to configure
  • Notifications, connection to other services like Bitbucker, Slack
  • Support for Python, C++, C#
  • Run on own linux-based virtual machine together with other services (wiki)

Exisiting solutions:

  • TeamCity

Even I was or I’m using all of them and because of linux-based machine, my hidden favorite was TeamCity. It looks more “professional” that Jenkins :).

Setup

So, let’s setup it. I have established the smallest Azure virtual machine:

Standard Virtual Machine A0 (Shared core, 768 MB memory) with Ubuntu Server 14.04 LTS. I thought it is enought – there will be wiki which uses almost no resources and CI itself, which consume more resources only it is doing something – building, testing or deploying. I have established TeamCity, run it and … nothing. OutOfMemory on the machine. Even I have set different arguments for the JVM,TC neeed more. So I have found that minimal requirements are 750MB only for the JVM (https://confluence.jetbrains.com/display/TCD8/Installing+and+Configuring+the+TeamCity+Server#InstallingandConfiguringtheTeamCityServer-SettingUpMemorysettingsforTeamCityServer).

Ok, lets set better machine – Standard Virtual Machine A1 (1 core, 1.75 GB memory). TC was running. But the ‘feeling’ from the browsing was ‘slow’. So I established simple build of the Python project. It was running fine and the build was successful. Nice. But the second build failed – not enought memory. What?! Next Azure VM A2 has 3.5 GB memory which is needless!

Sorry TeamCity. The last change was Jenkins. Set A0 again, setup build, run and … success! Run it again, again, again and fail. Check the logs … not enought memory. Ok, after five minutes of cursing on greedy JVM, I setup A1 back. Jenkins web was ‘very fast’. Seems good, lets try to run multiple builds, multiple times to be sure. So after 20 successful builds, no memory execption and check of VM memory consumption, it seems it is enought (but I will see in the future)!

Conclusion

I have to say that it was surprising to me that even you want to have own CI for a few of  your projects and run it ourself, you need a quite strong machine to be able to have proper running CI service.