cloud composer airflow plugin usage - airflow

I am just starting with airflow plugins and am a bit confused.
I am running it as a managed service using Cloud Composer on GCP (composer-1.13.4-airflow-1.10.12)
I wrote the plugin as per the docs but don't really know how to 'use' it
class TestAppBuilderBaseView(AppBuilderBaseView):
#expose("/test")
def test(self):
return self.render("test_plugin/test.html", content="Hello Starlight!")
v_appbuilder_view = TestAppBuilderBaseView()
v_appbuilder_package = {"name": "Test View",
"category": "Test Plugin",
"view": v_appbuilder_view}
class AirflowTestPlugin(AirflowPlugin):
name = "test_plugin"
appbuilder_views = [v_appbuilder_package]
Cloud composer UI kick me over to https://[alpha-numeric].appspot.com/admin/ but I can't seem to find the exposed route for my apps plugin. I’ve tried https://[alpha-numeric].appspot.com/admin/test and https://[alpha-numeric].appspot.com/test
I can get a menu link plugin to show up so I know that i am uploading the files to correct location in the storage bucket.
WHAT AM I MISSING HERE?
Any help would be appreciated, thanks :)

I'm not sure I understood exactly your question, but if you want any sort of webserver plugin to work, you must disable dag serialization as explained here.
After the lengthy Composer restart, it'll work both in the flask based and appbuilder based ui. source

Related

how to run amplify codegen in where codegen is already configured?

we have a project repo where backend team have added new apis.
other developers have run and configured amplify and codegen.
now I want to add these new queries and their types.
when I run amplify codegen i get this error:
Please download the schema.graphql or schema.json and place in C:\leag\nevClon\newwebsite before adding codegen when not in an amplify project
and when i run amplify add codegen it says Codegen support only one GraphQL API per project.
could someone guide me whats the right way to do that.
I've seen this problem in the past. Things I've tried include ...
Make sure you are in the correct amplify environment.
Run amplify pull to ensure you are up to date.
Try re-initializing using amplify init
When all else fails, try re-cloning the repository.

Connecting Firebase with NativeScript

So i installed firebase with adding the "google-services.json" in the App_Resources/Android folder.
After that i used the cli for the cmd: "tns plugin add #nativescript/firebase".
And it was successfull.
But if i try to use "firebase.firestore()" i get the message that firestore is unknown.
Yes i have ticked yes in the installation as it asked me if i want firestore.
So it should be useful but it is not.
I deleted the "firebase.nativescript.json" and run the 'npm run config' command in the android folder but it didnt help.
Then I uninstalled the plugin with "tns plugin remove #nativescript/firebase" and re-installed it.
Nothing works. Here is my fire in #nativescript:
Is there a Solution?
You should be able to import firestore directly from #nativescript/firebase and access its properties that way
import { firestore } from '#nativescript/firebase';
// firebase.firestore().collection('user') becomes the following line
firestore.collection('user')

How do you import config sync files in a Drupal 8 functional test?

I would like to know how to import config sync files in my functional tests for modules I am testing. For instance, I have some custom content types I would like to test against, and there are a number of files in config/sync that pertain to the node modules that defines the custom content type.
class ArticleControllerTest extends BrowserTestBase {
protected static $modules = ['node', 'dist_source'];
}
At the top of my test I define the modules which do succesfully import, but it doesn't include the config sync settings so none of my custom content types are present. How can I import these into my test environment?
At the beginning of testing for Drupal 8, I had the same question. After reading some documents and tutorials, I tried and know several methods:
$this->configImporter() helps import the configurations from sync to active
$this->configImporter() exits in Drupal\Tests\ConfigTestTrait. And the trait has been used in some based test classes, like BrowserTestBase.
However, the method doesn't work for me. Because, I used thunder installation profile. The default content exists after the profile installation was completed. Once the $this->configImporter() starts to import sync configurations, it encounters errors that some entity types fail to be updated, because the entities already exists.
Create a testing profile
(Haven't tried)
If the Drupal site installed by standard profile, you may try to put the sync configurations into a testing profile. And Install Profile Generator module may helps you create the testing profile. There is a related issue #2788777 with config and profile
Put the configurations which depend on module into config/install or config/optional
(Work for me)
Contributed modules always put the config into config/install and config/optional. Once the module is installed, the configurations will also write into database or active storage. Documentation - Include default configuration in your Drupal 8 module
When developing configurations in module, Configuration development helps export the config into config/install of the developed module.
If anyone has the same experience, look forward to share with us.
I do it in my testing base class (extends BrowserTestBase) in setUp() like this:
// import config from sync
$config_path = '/home/rainer/src/asdent/config/sync';
$config_source = new FileStorage($config_path);
\Drupal::service('config.installer')->installOptionalConfig($config_source);
works great.
It's just like a drush cim sync
And provides the production config to my end-2-end automated phpunit tests in gitlab CI.

Export everything from Alfresco

I need to export everything (sites, dashboard, users, groups ecc...) is under my Alfresco ed import all to another Alfresco installation.
I discovered this usefull tool https://github.com/atolcd/alfresco-share-import-export but seems to me that it is good to create an .acp of a site for example but it's not enought for others stuff expecially users.
Please, what's an easy way to export everything from Alfresco ? And then how to import ? Thank you.
I used this Pynthon scripts github.com/wabson/share-import-export but no way an error on the python script execution : C:\Users\xxx\Desktop\Nuova cartella>python export-users.py file.json --username=xxx --password=xxx --url=localhost:8080/share/page/site/xxx/dashboard File "export-users.py", line 5 ^ SyntaxError: invalid syntax
I have Alfresco 5.1 and Pynthon 2.7.12
screenshot
Your url param is incorrect. Use the below one.
python export-users.py file.json --username=admin --password=admin --url=http://localhost:8080/share
This should work for you.
The Share URL should be, http://<IP or systemname>:<portnumber/share, but you've mentioned the one site dashboard url. Please change that.
You can also use alfresco OOTB replication service and replicate all the data from one alfresco instance to second one.

Firebase client on ReactNative

When using Firebase on ReactNative, it will show such error message:
can't find variable process
However, if I require firebase/lib/firebase-web.js manually, it will show:
can't find variable document
How can I resolve this?
I just went through the same issue while trying to use sockets.io in my react native app so hopefully I can help.
The reason that you cannot use firebase's node module is because there hasn't been a polyfill created yet for websockets support (which firebase is dependent on) in react native.
If you take a look at issue #619 in react native's repo you'll find the current discussion on creating a websockets api polyfill.
The way that we solved it is by using Jason's modified version of the sockets library and creating our own repo around just that file. Then we added the line below to our package.json dependencies.
"react-sockets": "crewapp/react-native-sockets-io"
The reason that Jason's version of the sockets.io client file works is because react-native is added as a user agent. You can find the code that makes this change at the top of the file:
window.navigator = {
userAgent: "react-native"
}
Once you've gone through these steps you should be able to require sockets.io / firebase as normal.
Just figuring it our. Pavan's answer is helpful, but it is not quite true when using with Firebase.
For firebase, please follow the steps:
Download the firebase-debug.js from wsExample. Or you can just install wsExample by npm and require the firebase-debug.js inside it.
Use badfortrains's forked React-Native:
"react-native": "git://github.com/badfortrains/react-native#WebSocket"
New the Firebase like this:
var firebase = require("../../firebase-debug.js");
var rootRef = new Firebase(Const.FB_ROOT);
Things should just work now!
I had issues with socket.io on React Native too, solution was to get notifications about new data and if data is big enough - get it by simple RESTfull request. in my case data was small enough to be sent all within notifications API.
I was using GCM service to send notification to phone from nodejs server. BTW, it uses less battery then socket connection and works great :)

Resources