I want to make some little changes in OpenBTS code and use it. Currently I am following this process
Make some changes in code. ( Can't do testing of these changes at runtime)
Build the packages
Install the packages
Setup or Run OpenBTS
Test the behavior of OpenBTS to see that those changes are reflected or not.
If not working, goto step 1
This a quite hectic process, is there any smarter way to do it. Like OpenBTS is directly run from code, rather than packages installed on Ubuntu. If I make change in code, and they are directly reflected in my setup. How i can setup this dev environment.
This answer is a bit late, I have just started to work on this my self. I don't bother installing the packages each time. My cycle is more like this:
Build the packages
Setup/run the database scripts (init the databases)
Install the packages that I don't need to re-build
Run each package manually (from the open BTS folders), e.g. run ../Transceiver, ../sipauthserver, ../OpenBTS, ../OpenBTSCLI ...etc...
Then when I want to make a code change - I do:
Stop everything
Code change
Re-build (e.g. just openBTS)
Re-run everything as before.
I also scripted the startup / stop sequences to make this faster (open/run each app in new terminals)
Related
I have a node.js application I have adopted from a more senior developer. I want to deploy it, and I know it will work because he already deployed it several times. I am reading these instructions:
https://galaxy-guide.meteor.com/deploy-quickstart.html
I use windows, as did he.
How does deployment work?
Take these instructions:
Windows If you are using Windows, the commands to deploy are slightly
different. You need to set the environment variable first, then run
the deployment command second (the syntax is the same as everything
you’d put for meteor deploy).
In the case of US East, the commands would be:
$ SET DEPLOY_HOSTNAME=galaxy.meteor.com
$ meteor deploy [hostname]
--settings path-to-settings.json
Am I just supposed to go to the source directory on my laptop and run these commands? What then happens? Is the source uploaded to their server from my laptop and then their magic takes care of the rest?
What about when I want to make a change to the code? Do I just do the same thing, poiting to an existing container and, again, they do the magic?
Am I just supposed to go to the source directory on my laptop and run these commands? What then happens? Is the source uploaded to their server from my laptop and then their magic takes care of the rest?
It is not magic. You basically go to your dev root and enter these commands. Under the hood it builds your app for production (including minification and prod flags for optimization) and once complete opens a connection to the aws infrastructure and pushes the build bundle.
See: https://github.com/meteor/meteor/blob/devel/tools/meteor-services/deploy.js
On the server there will be some install and post install scripts that set up all the environment for you and, if there are no errrors in the process, start your app.
These scripts have if course some automation, depending on your account settings and the commands you have entered.
What about when I want to make a change to the code? Do I just do the same thing, poiting to an existing container and, again, they do the magic?
You will have to rebuild (using the given deploy command) again but Galaxy will take care of the rest.
I have my work computer which is a Windows 10 Pro and my laptop is a Windows 10 Home. Working on the same project on both: push and pull to Git. Learning React through Udemy. Both computers using Chrome. Both using Bash on Ubuntu on Windows with latest updates. Both using ConEmu for the console. Both npm -v = 3.10.10. Both node -v = 6.11.2. Hardware is different obviously, but not sure that is relevant and worth listing.
Anyway, this starter project I am playing around with, when I make changes to it and npm start is running, you can see activity in the console, hit refresh in the browser, and any changes made will be reflected.
On the laptop, this process does not work. Make change, save, no activity in console, refresh in browser does not reflect the changes. Have to restart npm start for changes to be reflected. A little irritating to say the least.
Anyway idea what might cause this? Really haven't come across anything in my Googling efforts.
If you are using npm in WSL2.0 for development, please refer the last point in this-
https://create-react-app.dev/docs/troubleshooting/#npm-start-doesnt-detect-changes
While WSL1.0 doesn't use a VM, WSL2.0 does use a lightweight VM, so adding
CHOKIDAR_USEPOLLING=true
in a .env file in the project directory fixed the problem.
On a sidenote, you might wanna take a look at this
Client side
To ensure client side changes aren't being cached, you can open devtools > Network, and check "Disable cache". After enabling this, you won't have anything in the cache as long as devtools is open.
Alternatively, you can use incognito / private browsing mode to prevent the cache from holding on to things.
Server side
I'm sure you've realized that it's a pain to restart your server every time you want to see your code update. There are several tools that will detect file changes and handle restarting the server automatically.
PM2
Nodemon
Forever
I just add file .env and inside FAST_REFRESH=false.
For me, working in Windows, WSL2 caused this not to work. Running npm start in Command Prompt, not WSL solved this issue for me.
Does SublimeText 3 / GoSublime have some type of caching of Go import packages? If so, how do I clear it on demand?
I ask because while writing a custom package that is under Github source control, it works until I refactor a func or struct. Then, back at my main app (of where I import this package) it lights up like a Christmas tree when I start using the new methods.
GoSublime (or GoLint?) does not pick up the refactored func changes, and everything shows as an error. But yet, I can go to a prompt and run go build and go test just fine - the Go tool works fine.
The only thing I have been able to nail down is after about 24 hours it seems to work?
OSX 10.9
SublimeText 3
GoSublime
sublimelint **<- DO I NEED THIS? SAYS IT IS FOR HIGHLIGHTING**
SublimeLinter
SublimeLinter-contrib-GoLint
SublimeLinter-contril-GoType
(and a few other packages)
I'm a SublimeText novice; but, I believe I have everything linked up and the required packages installed. Sublime's console shows no errors in the Linters (says it find gotype and golint).
SublimeLinter: gotype activated: /Users/user1/go/bin/gotype
SublimeLinter: golint activated: /Users/user1/go/bin/golint
Things work beautifully within the package itself. It's not only my remote app. In my package, I have an "/examples" directory of tests that doesn't even pick up the changes in the root package. But again, the actual Go tool does and builds and runs all tests using the new refactored code.
It is GoSublime/GoLint that is caching the import's schema/package details. How do I clear that?
Thanks!
Coming back to answer myself this after 5 months of no answers...
#dave-cheney himself replied to a Google Groups message I posted on this subject:
https://groups.google.com/forum/#!topic/golang-nuts/N3xB6PGs3wo
Resolution:
That code, even one-off tooling for other projects, must live in your $GOPATH/src. I have changed all projects to be in the $GOPATH/src/privatedomain/etc, and updated build scripts to just deploy the executable to those other repos (and commit them). Learn to work with the tools, not fight it. :)
You need to run go install [package] on those locally developed packages for their changes to show up immediately in your current Sublime project. There is still a long day-long delay that happens though if you don't run go install that the changes are picked up in other tools/packages within Sublime. "go install" works to get around this every time so no big deal (*see next bullet point).
In Sublime, I often run go install [package] and then close/re-open the current file I am working on to pick up the changes.
Note that you don't have to be online for the go install [package] - if the package is local that is (e.g. in development). So, this was the answer to my environment since I do a lot of development offline (commuting).
I am trying to set up a development environment with Vagrant. I am using centOS 6. From what I have read about Vagrant, I should set up provisioning scripts to install the packages I need when I run vagrant up. For me, this process takes quite a while. However, it seems like it would be more efficient to install everything one and create a new box. Is there some advantage to provisioning that I'm missing? What is it best for me to do in this case?
You can provision everything and when you want to run vagrant up for the nth time you can do so without provisioning:
vagrant up --no-provision
As to why provisioning? It's mostly so that you can easily take the base box and then change for example one or more items in the list to see the effect.
But it keeps the base clean and reusable.
I have a Fedora 10 64-bit server where I want to set up a nightly fresh install. The server is an exact clone of our customer's hardware and is used for running acceptance tests.
I would have liked to set this up using a virtual machine, but that's prohibited due to problems we've had with the different video and network drivers on the VM.
Here are the basic steps I need to automate:
Reinstall base Fedora 10
Update to the latest packages
Install additional packages (some of these come from the rpmfusion repository and our own private repository, so the repo files for these need to be added to the configuration)
Restore file system table to include a NAS mount
Restore users and home directories.
I've looked at using Kickstart to do the installation, but it looks as if that will only satisfy the first step above by just answering all the questions that you'd normally answer interactively during installation. Does anyone know of a more suitable tool that I could use ?
Edit: looks like respin could also be very useful here.
You could look at something like
fog - http://www.fogproject.org/
clonezilla - http://clonezilla.org/
Basically these two applications are for the automated, unattended deployment of backup images to machines. They tend to be used in large enterprises but can be used for what you want to achieve.
I have only used clonzilla but fog can apparently run script after a pxe boot install. You could clone the device after all the steps above and just push down the image with a nightly reboot , you could use clonezilla or fog for this, or you could use fog with a script to apply the chances after a clean image has been installed on the server
Kickstart can do more using a %post section
Just wanted to elaborate to #BenBruscella's %post post.
Kickstart has a section where you can include or call up any post-install script to start after the main installation stuff is done.
With this you could easily do your package updates and mounts.