How can I create a testing environment for a project in gcp compute engine? - testing

I am working on a project on GCP. It is a website that is live. It is running on a compute engine based on Ubuntu Linux. The problem I am trying to solve is how to create a live testing environment. Here is the flow of thoughts:
I have the live version that is working fine
I then create a feature that I want to deploy to the live version
But before deploying it, I want to test if the project will still work fine without errors on GCP.
Therefore, I want to find a way of deploying the test version of the project on gcp, and access it live, without tampering with the old version
Both of them need to be running live on GCP, so that I can see the contrast between the standard live version and the testing version
I have not tried anything yet. I am confused on where to start. I have checked out some proposed solutions online: Terraform and Docker mainly. But then I don't know how to go about it.
My expectation is that if I go to live-working-url.com, I get the stable working version of the project. Then be able to set up something like testing.live-url.com and see the test version. Both of these should be coming from the GCP compute engine.
Also, if there are other thoughts and ideas on how to work with testing in GCP, please share, they are highly appreciated
Thank you.

Related

How to create and share a VM environment for development

I am working on a college project along with a group of people. Our goal is to add features to an already existing application that runs on the web. Currently, I'm in the process of getting the source code to run on my machine. This consists of cloning a bunch of repos, installing MySQL and some (very old and outdated :-| ) versions of Python, and running some scripts. The process sounds straightforward but it isn't; there are a lot of dependancies that need to be met for the code to run, which means that I need to spend a lot of time looking at error logs trying to figure out what package is missing and needs to be installed or downgraded. But that's not the point of this question.
I'd like to make it easier for people to pick up the project in the future and work on it without having to spend hours just to get the code to compile. I'd like to get the project set up on a Linux VM (something I know how to do using VirtualBox) and then somehow share (?) that VM so that other people can simply set it up and be able to immediately have the code compiling (something that I don't know how to do, or if it is even possible).
Additionally, I'd like to be able to do all the coding on the host OS if possible, and only do the compiling/running on the VM (something I also don't know how to do). I would like some help/pointers with all the "I don't know" 's, as I don't know much about VM's other than how to set one up using VirtualBox.
You can use Vagrant to automate the provisioning of the VM, and setup all your tools and dependencies using Docker.
There are many good tutorials and sample vagrantfiles online to get you started. There is a learning curve involved, but well worth the effort. Many companies use Vagrant to quickly provision dev environments.
Vagrant can automatically download a specific distro/version of a VM from the web if one is not already locally installed. It can also provision a Docker container, in which you can install any required dependencies, tools, etc. You can store the vagrantfile, dockerfile, scripts, etc. in GitHub for easy access by your colleagues. All they would have to do is install Vagrant and run vagrant up from the command line.
If you want to write code on the host machine and compile/test it on the VM, you will need to setup a shared folder in the VM using Guest Additions (see here). Be VERY careful with line endings if you are working in Windows and running in Linux. You can setup the shared folder with Vagrant as well (see here).

Run Chaos Monkey locally on mac

I was trying to setup chaos monkey locally on my mac. Couldn't find much documentations regarding this. The official docs are incomplete/ or in progress. I'm new to chaos engineering and have never worked with the simian army tools.
I was able to find a lot of guides to install chaos-monkey on distribution platforms. But couldn't find any useful documentation for doing the same on a local system to test.
I'm aware that I'll need spinnaker and mysql set up for it to run.
I was thinking of installing spinnaker on a local kubernetes cluster and then try configuring that to set up chaos-monkey. I found this guide to do the same. But ended up overloading my mac (has 8GB ram) and it shut down.
Also tried setting up spinnaker on docker using this guide, but ran into some version issues.
Is there any other memory efficient way to install chaos_monkey locally and use it to attack kubernetes nodes or even VMs? I'm aware of kube-monkey, but that's not what I'm trying to test here.
Any suggestions on how to set this up locally are also welcome.
I ran into this same problem around Chaos Monkey a couple of years ago. The setup is complex enough that finding foolproof steps is a little challenging. Here's a comprehensive guide that is useful: https://www.gremlin.com/chaos-monkey/chaos-monkey-tutorial/
As an alternative, Gremlin's Free Product isn't open source, but gives you Chaos Monkey / shutdown functionality with a very simple install process. gremlin.com/gremlin-free-software.

MobileFirst CLI - edit/build/test cycle

One thing I really like about the later version of Worklight/MobileFirst Studio is the faster edit/test cycle when working in the Mobile Browser Simulator: just edit, save, click Go/Refresh; no need to build/deploy.
When using CLI (6.3.0.00.20141111-1216) this does not seem to be the case. Seems like I need to do
mfp build; mfp deploy;
After every edit. Am I missing a trick?
Right now I'm thinking I need to revert to my old practice of setting up a web-server to serve directly from my product folder, which is not ideal because I then need to mock up the WL.* APIs I use.
This information from Karl Bishop:
At the current time, this is a limitation of the CLI, based on the use of a standalone MFP Server. Within Studio, some special tricks are being played, to just updated modified files. We are working to resolve this in the CLI and perform similar per file deployments, but we're not there yet. In the interim, I encourage you to view Justin Berstler's video on using the CLI with Grunt.

How to run dart spark on my own computer?

I see there is a project named spark, which is a Chrome app based development environment.
It seems interesting, and I want to run it my own computer(mac os), expected to see a chrome-based IDE for dart. But I can't find any document to tell me how to run it. There are just some pages for how to develop and test, but how to run it?
I tried with the grind shell with all kinds of options, but no lucky :(
Thanks for the question! The Spark effort is still spinning up, and we're not yet ready for a public release. All the source code is available publicly, so it is possible for people to build it for themselves. Once we're further along we'll put a developer preview release up on the chrome web store.
The steps to build & run Spark IDE on Windows are:
Install Dart SDK to e.g. C:\dart-sdk
Download the Spark source code to e.g. C:\spark
Open cmd and type: cd C:\Spark
set PATH=%PATH%;C:\dart-sdk\bin
set DART_SDK=C:\dart-sdk
pub get
grind.cmd deploy
Load the upacked extension from C:\Spark\ide\build\deploy-out\web in Chrome Dev.
Alternatively, you can download Chrome Dev Editor packaged app, based on Spark 0.13,

Distributing TideSDK application

I recently finished an application based on Titanium, Javascript, HTML, CSS. I have only been a web designer to date so I have little experience in distributing applications. I was accustomed to the TiDev Community deploying app, which prepared the app for download and made it available for download at a given link.
But tidev community is no longer supported, so I use TideSDK Developer to package the app, which doesnt do all the hard work the other one did so nicely.
I am obviously a complete rookie to this.
Could anyone outline the steps I would need to take to go from the bundled application folder I have now (put together by TideSDK Developer), to a link that will allow customers to download and install the app or online? I know there is an issue with packaoging the app for platforms other than your own, and that appcelerator is working on a solution to this I think. I also realise I would probably have to pay to host the download online. Any guidance would be greatly appreciated.
You must use the tidebuilder.py script. to compile a installation package. To compile a binary for a Mac, you must run the script on a Mac, to compile a binary for windows, you must be on a windows box etc.
There is some documentation on how to use it here per platform. The command is very simple and works.
Once you have your application file (DMG for OSX or a MSI for Windows) then just distribute it however you see fit, email, putting it on your web server, whatever works for you.