Docker Compose for integration testing

Published June 17, 2018 in devops - 0 Comments

For integration tests with few external dependencies that don’t require much orchestration beyond networking Docker containers and setting up environment variables, Docker Compose is a simple and easy to manage solution for building, running and tearing down tests. This Flask application example is typical. The project’s multistage Dockerfile defines both the service and test images: […]

Tags: ci , docker

Why do I use containers?

Published May 2, 2018 in devops - 0 Comments

Here are my best reasons for using container solutions like Docker: 1. Simplify the deployment process! I used to struggle with software deployments. Traditional software package installers work fine for simple deployments on a single platform type, but require maintenance if deployment guidelines change between OS verisons. Deployment tools that need to target multiple platforms […]

Tags: docker , python

Pandas DataFrame axis basics (Part 2)

Published April 13, 2018 in data - 0 Comments

Part 1 covered Pandas DataFrame basics. Pandas offers multiple options for accessing DataFrame values by axis labels using he DataFrame.loc function, or by integer indexes using the DataFrame.iloc function in one or two dimensions. If the DataFrame has a numerical index, calling the DataFrame.loc and DataFrame.iloc functions looks the same. Otherwise, use the appropriate axis […]

Tags: pandas

Pandas DataFrame axis basics (Part 1)

Published April 2, 2018 in data - 0 Comments

By default, a Pandas DataFrame is 2 dimensional with 2 axes initialized as empty Index structures. Under the basic indexing scheme, the first axis is the ‘index’ axis, which by default is a numerical index starting from 0 (using np.arange) generated for each DataFrame row. The second axis is the ‘columns’ axis, which is the […]

Tags: pandas

GitHub GraphQL in CI

Published March 9, 2018 in devops - 0 Comments

All python code is Python 3.5+. Having an automatic way to build GitHub pull requests before merging saves a lot of time and trouble compared with pulling, building and testing a GitHub pull request locally. TeamCity makes it easy to set this up using branch specifications. The blog post refers to a much older version […]

Tags: ci , git , graphql , python

Python type hints: alias those types!

Published February 21, 2018 in programming - 0 Comments

All python code is Python 3.5+. PEP484 goes beyond built-in type annotations. Another feature of the Python type hinting libary is the ability to create type aliases. I’ve used type aliasing frequently in C++ (typedef, using) to improve code readability and for its other benefits. I’m happy to see that it’s available in Python too. […]

Tags: python

First look at GitHub’s GraphQL API

Published February 20, 2018 in devops - 0 Comments

Sometimes it’s necessary to query GitHub for repo information through an API; during a continuous integration (CI) build step for example. I’ve used GitHub’s REST API before, which is OK but dumps a lot of extra data that can be annoying to parse. Also, sometimes multiple queries are needed to get to the data I […]

Tags: ci , git , graphql