What is the difference between CrudRepositoryImpl and DefaultCrudRepository in loopback v4? - loopbackjs

There are 2 repository implementation classes in loopback-next repo. The one that is used when a repository is created by CLI is DefaultCrudRepository. We have been using this in many places successfully.
But while looking for ways to customize repository to have dynamic datasource instances, I just saw one CrudRepositoryImpl here. Can someone explain what's the difference ?
Any use case where we will need to use CrudRepositoryImpl ?
Any help will be really appreciated.

Related

create instance template from private repo

I'm trying to create a GCP instance template which has the most recent version of my repo on it. My repository is private and I cant figure out how to clone it in the instance groups. I don't think I can use SSH because the machines will be randomly destroyed and created and therefore the generated keys will be inconsistent. Whats the best way to do this?
An Instance Template is based on an Image. This image can be a clean Ubuntu/Windows/Debian copy or a custom image created by you.
Saying that, I can think of 2 ways for you to get your repository inside there.
Using a custom image.
In essence, A snapshot of an instance with your latest code and dependencies installed on it.
There are two paths you can go with here.
a. Create a custom image when you clone the repository to the instance. You might need to that for every update in the code.
b. An alternative is to use some sort of Network File System (NFS/SMB). This will usually require more resources like another server that is always available.
If you want to avoid creating images, or as a solution to the issue mentioned in 1a you can set up a Startup Script to run on the server at boot(creation) time to clone/pull the latest copy.
There are Pros and Cons for both. I guess only you can tell what is best for you. I hope it gets you in the right direction.
Read more about creating an image here.
Read more about startup scripts here.

How to implement microservices in django and make them communicate with one another

I'am new with the framework django and I want to realize a project using microservices.
I have been looking for detailed documentation about but til now I've found nothing
very helpful and which explains the procedure step by step. Different microservices must be able to communicate with one another.
I've already tried django microservices explain by Pypi but no good results.
So if someoene can help me with the procedure or templates for microservices I'll be grateful.
PS. My OS is windows7 64bits and I can't use docker on it.
Thank you for your help...

How to test Elasticsearch index creation?

I would like to write a JUnit Test using any kind of embedded Elasticsearch engine in order to test my services which should create indexes with mappings on start-up. What is the best way to do it?
Probably, it would be also enough to use ESTestCase. Unfortunately, I cannot find simple usage examples. Could anyone provide one?
There is no embedded Elasticsearch since 5.x any more. I would use Testcontainers for this: https://github.com/dadoonet/testcontainers-java-module-elasticsearch
PS: This code will soon move to the Testcontainers repo.

Could we make spring-lemon available in maven public repository?

I'm trying to deploy a spring-lemon app from github.
But the way the documentation advised to obtain and install the jar, isn't working.
While I keep on trying to sort this out, I wonder if it's possible to make spring-lemon available in maven public repo ?
That would be the perfect way to solve the problem.
I fully agree, and would like to see it in the central maven repository in fact. But, it needs some preparation to get approved. Sometime back I had tried it with some other project, but couldn't get approved.
So, it's low in my priority list now. Could you please create a ticket in GitHub, and it would be great if someone volunteers to take up this before I can.
Update 2021-08-21: 1.0.0.RC6 onward available on maven central

understand how opsworks and custom cookbooks work together

I have my stack on opsworks and app is deploying fine (cake php).
Now I have to configure some things like chmod, php versions, etc etc... I'm reading about this but don't know exactly whats the best way to do this.
Question 1 - Should I do this with custom deploy JSON or via custom cookbooks?
Question 2 - Whats the correctly way to work with custom cookbooks? Fork original AWS repositories, update recipes and then use it in my stack?
depends on what you would like to achieve, you may implement many things, such as:
a recipe, which is invoked only once during a chef-client run.
a lightweight resource provider, which supports notifies and can be invoked zero or more times.
a definition, which is available before resource collection and can be invoked zero or more times.
for your second question, first checkout berkshelf -- a cookbook manager.
i would suggest forking a project only if the project is dead, otherwise i would consider to contribute to already implemented project so everybody will benefit from it; and you can always write your own wrapper cookbook, you can also refer to Chef wrapper cookbook best practices.