Hot answers tagged

21 votes
Accepted

Dockerized Flask: Connection reset by peer

Trying to connect from outside fails Are you actually connecting from outside? Flask is binding to localhost (127.0.0.1) and that will only be reachable from within the container. If you're on your ...
user avatar
  • 1,342
9 votes
Accepted

Git Files Encryption for Business

There really is no way to take on your problem with git, which is to deny a developer with access to the code (required to work with it) the possibility to steal the code. This is because as soon as ...
user avatar
  • 4,726
8 votes

A systematic way to test RESTful APIs with curl?

You could look at tools such as Postman which focuses on testing REST APIs with JavaScript - it has some nice features but you lose the use of Python. Instead, I'd suggest looking at REST-related ...
user avatar
  • 832
7 votes
Accepted

Passing variables between scripts in a Jenkins pipeline

For Declarative Pipeline: This question already has a highly-upvoted answer on StackOverflow: If you want to use a file (since a script is the thing generating the value you need): pipeline { ...
user avatar
  • 2,753
5 votes

How to automate Powershell's interactive Get-Credential method?

Your python problem is the \n after the commands, write already append a newline, so your script does the following: $cred = Get-Credential # Start the command # This line is ignored as extraneous ...
user avatar
  • 11.1k
5 votes
Accepted

Re-using Python virtual environments on a build server

It's generally a best practice to make your builds idempotent. Leaving artifacts behind only opens up opportunities for dependency management issues- and resolving those in a resilient way is exactly ...
user avatar
5 votes

What's a good devops approach for a single developer writing python web applications?

I am not familiar with Python development nor DigitalOcean, so I'll just offer a few pointers: The goal is to automate. Everything. How you achieve that is really up to you, and creating your own ...
user avatar
  • 4,726
5 votes

Passing a jenkins credential (global) to a python script

Specifically for credentials, CloudBees recommends using the Credentials Plugins, which inject the credentials in the environment available to the invoked scripts. From Injecting Secrets into Jenkins ...
user avatar
5 votes

What's the benefit of using Nginx to serve a Flask API on AWS?

Unless you are using the AWS API Gateway, you'll still need some way of "serving" your Flask API. You will also need to provision an EC2 instance and run something to serve your API. Instead of ...
user avatar
4 votes
Accepted

Re-using Python virtual environment vs Re-building it

What are the general ways to tackle this problem? The ideal way to resolve your problem would be to dockerise your application, as it would remove any worries you have about compatibility between ...
user avatar
  • 1,345
4 votes

Recommendations about release convention or standard for Python scripts?

One could consider to package the scripts. Depending on the distribution, e.g. ubuntu, windows, centos one could create a ppa, nuget or rpm respectively. Once a newer version is installed, the package ...
user avatar
  • 12.6k
4 votes

What approach should I follow for adopting continuous integration?

I am in a similar pair of shoes as you - I am currently, slowly, getting into the DevOps topics after having many, many years of conventional development (and close connections to conventional ops) ...
user avatar
  • 4,726
4 votes

Passing a jenkins credential (global) to a python script

If you are using Pipeline (i.e. Jenkinsfile), use withCredentials. To give a quick and dirty example: withCredentials([[ $class: 'UsernamePasswordMultiBinding', credentialsId: 'my-credentials', ...
user avatar
  • 2,753
4 votes

Are AWS Boto3 calls asynchronous?

Boto3 is a client for AWS API, so by definition it doesn't handle the synchronous or asynchronous behavior of the API call, that's the API endpoint which define that. You can safely assume that any ...
user avatar
  • 11.1k
3 votes

How to connect to external etcd server inside of docker container (python application)?

The error you see in your container is: etcd.EtcdConnectionFailed: Connection to etcd failed due to MaxRetryError(u"HTTPConnectionPool(host=u'localhost', port=2379): Max retries exceeded with url: /...
user avatar
  • 372
3 votes

Re-using Python virtual environments on a build server

You may want to take a look at the ShiningPanda Plugin. It allows running a build step inside a particular python virtual environment, created automatically if it doesn't exist or reused if it ...
user avatar
3 votes

Re-using Python virtual environments on a build server

I'm going to add more story to the answer @esoterydactyl gave, in case it goes over too many people's heads. Instead of a monolithic build process, maybe you want to build intermediate packages that ...
user avatar
  • 314
3 votes

What approach should I follow for adopting continuous integration?

As you are already using Bitbucket, Bitbucket pipelines could be useful. What languages are supported? Node, Ruby, Python, PHP, and more. Anything you can run in a Docker container is ...
user avatar
  • 12.6k
3 votes
Accepted

Using Anaconda instead of pip+virtualenv

In my field (science) Anaconda is probably the most common Python distribution in use. conda is the package manager (just to be clear of the distinction). It is difficult to find fault in conda when ...
user avatar
3 votes

What are the pros and cons of running application testing during vs. after a docker build?

I support J.Doe's suggestion for separate Docker files for each of the build and test stage. Such approach also allows you to: re-run the test stage for whatever reason (known intermittent failures, ...
user avatar
3 votes

What's a good devops approach for a single developer writing python web applications?

Thanks for the great question. Nothing is really trivial the first time you do it and we all were new to something once. My first recommendation is to revisit docker. Try some different guides and ...
user avatar
  • 759
3 votes
Accepted

How to connect to host during a Docker build?

From your container's perspective localhost is the container itself. If you want to communicate with the host machine, you will need the IP address of the host itself. Depending on your Operating ...
user avatar
  • 728
3 votes

How to install aws cli on a self-hosted azure DevOps Windows agent?

The best way to have AWS CLI tooling installed to your custom agent is by installing from Visual Studio Marketplace. AWS CLI is part of AWS Tools for Azure DevOps Service and Azure DevOps Server (the ...
user avatar
3 votes
Accepted

Strange behaviour with docker-py

docker.containers.create() is documented to: Create a container without starting it. Similar to docker create. Either call docker.containers.run() instead, or given the container object returned ...
user avatar
3 votes
Accepted

Is there any Jenkins plugin for pylint results?

Jenkins accepts JUnit-formatted test results with the JUnit plugin, so you could try pylint-junit to output JUnit-formatted results (I have not tried this myself). Also it looks like a very similar ...
user avatar
  • 2,753
2 votes

What are the pros and cons of running application testing during vs. after a docker build?

If you run everything in the same container... PRO: you have solved the CasC challenge for configuring the testing environment inline as well CON: you miss the blackbox tesing part, imagine your ...
user avatar
2 votes
Accepted

Unable to get jupyter/scipy-notebook running on docker

It turned out to be an issue with port mapping. After mapping local machine port 8888 to docker's 8888 I could launch the program in browser. sudo docker run -p 8888:8888 jupyter/scipy-notebook
user avatar
2 votes

What approach should I follow for adopting continuous integration?

You've chosen a fairly difficult stack to support. WAMP is largely used in dev environments, and the windows builds of mysql, php, and apache typically lag their Linux counterparts by a significant ...
user avatar
2 votes

Problem with Anaconda installation

We recommend not adding Anaconda to the PATH environment variable, since this can interfere with other software read more ... Anaconda 4.4 added a feature to the Windows installer so that the “...
user avatar
  • 201

Only top scored, non community-wiki answers of a minimum length are eligible