Response
stringlengths
8
2k
Instruction
stringlengths
18
2k
Prompt
stringlengths
14
160
Usually python files end in py. the handler should sayscript: template-123.pyTest your cron job locally first. You should be able to access localhost:8000/_ah/admin, and click on the Cron Jobs link on the left. It should list all your cron jobs, and you should be able to test them with a link on the page. Debug on dev_appserver first.
I need help in implementing a simple cron job in GAE (python).According to what I understood from appengine documentation, I made a file cron.yaml in the application root directory with the following content:cron: - description: blah blah url: /crontask schedule: every 1 minuteAnd my app.yaml file has the following content:application: template-123 version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /.* script: template-123.appI made all my application code (cron and other parts) into a single file "template-123.py". In the code I implement cron in the following way:class CronTask(Handler): def post(self): i=25 number = Birthday(day = i) number.put()And I tell the code to use this class for cron by stating: ('/crontask', CronTask).However no new entries are uploaded to the datastore (as I believe they should be). And I know that it isn't a problem with the way I'm accessing the data store because when I try to do the same thing manually (upload entries to the data store in my non-cron part of application) it returns with appropriate results.So I need some guidance as to what might I be doing wrong or missing? Do have to make some more changes to the yaml files or add some other libraries?
Simple cron job in google app engine (python)
The cronjob is not executing in the same directory/environment as the script.You can address this by adjusting your cronjob:* * * * * cd /home/yourdir; ./loader.pyOR* * * * * /home/mc/dotasks.shdotasks.sh contains:cd /home/yourdir ./loader.py #anything else you need to do
I have an automated script - I mean, it runs every 10 minutes by a cronjob. The weird thing is: The file is always found and runs through it when I start the script by hand. But it gives me a lot of troubles when it runs by cron job.these are the rights of the files:-rw-r--r-- 1 dataloader users 181 Dec 19 12:37 Foo.after -rwxr-xr-x 1 dataloader users 26098 Feb 16 20:56 loader.pythis is an abstract of loader.py where it checks for Foo.after:if os.path.exists(self.customer+'.after'): print 'customer file exists' f = open(self.customer+'.after')
Can't find file with python script when run via cron
TheInput Class Documentationsays that$this->input->is_cli_request()uses the STDIN constant to check if its running on the command line.Try using the command line version of PHP instead (php-cli), since the STDIN constant doesn't appear to be set while running the standard PHP executable (php).
Here is my cronjob's commandphp /home/toolacct/public_html/index.php cronjob fetch_emailsHere is my CodeIgniter cronjob controllerclass Cronjob extends CI_Controller { function __construct() { parent::__construct(); die($this->input->is_cli_request()?'T':'F'); $this->load->model('cronjob_model'); } public function fetch_emails() { $this->cronjob_model->fetch_emails(); } public function index_popularity() { $this->db->query('CALL update_email_data_popularity()'); } }The cronjob says "F" Why?A side note: If I create a function like thisfunction is_cli_request() { return isset($_SERVER['SHELL']); }It returns true or false correctly, while CodeIgniter always returns false.
CodeIgniter is_cli_request() returns false when run from cronjob
error_handlermight help you hereOr this for fatal errors:http://insomanic.me.uk/post/229851073/php-trick-catching-fatal-errors-e-error-with-a
Is there a way to tell PHP to run one last function, or somehow override some error handler in the event of a fatal error? I have a cron that has a main entry point of:$obj = new obj(); $obj->run(); exit;Would wrapping that in a try catch do the trick if I'm not explicitly throwing errors? All I want is for PHP to do something as simple as create a txt file containing the fatal error, or even just create an empty file named 'failed.txt', or something.Thanks!
PHP - One last call
You can run chef-client as a daemon (-d option, as used in init scripts), or under a service management tool likeupstart,runit/daemontoolsor bluepill. You can certainly also launch it from cron - just make sure to not run daemon mode there :).Chef's resource providers take idempotent actions to configure the resources to be in the desired state. This means that if Chef has already run on the system, it only modifies resources if they do not match what the recipe says. For example, if you have a recipe that says:package "haproxy" service "haproxy" do action [:enable, :start] end template "/etc/haproxy/haproxy.cfg" do source "haproxy.cfg.erb" endThe package will be installed the first time chef runs and won't be modified again unless the package were removed from the system, or you modify the resource. Likewise, the haproxy service will be enabled (through your platform's service management tools, usually symlinks in /etc/rc*.d) and then started (e.g., via /etc/init.d/haproxy start). Finally only if the content of the template changes will Chef render a new version of the template. For templates it determines this based on a SHA256 checksum.There are a few exceptions - execute, script and ruby_block resources are not idempotent without you providing some kind of qualifier conditional.Also, Chef doesn't have "one time" or "one off" recipes run lists when using the server. There was athread on the Chef mailing listrecently about the topic.
First off, can (and is it good practice) chef run a recipe at a specified interval on a specific role?I've got a ruby script which manages user accounts and ssh identities, it currently runs on a cron every hour and I'd like to turn it into a Chef recipe for obvious reasons (I want it to be there on all machines).I can see two ways of doing this:Either turn the script into a template, the recipe would simply render the template to a given path and then register a cronjobORBreak the script into resources, providers, etc., and have Chef run it every hour.Ideas?
Chef - repetitive recipe execution
Use a script on Google AppEngine to "ping" yours (Scheduled Tasksto be more precise). It's free :-)
I want to call a php script every minute. My scriptruntime on my webserver is about 90 sec. I thought doing it with cronjobs but i have to pay for that service. Is there an other possibility?Thanks a lot.
call php script every minute
Cron jobs is a mechanism to automate tasks in Linux operating system. And has pretty little to do witn Zend Framework. The framework can help you develop an advanced cron task in php though. But then you will have to set up your cron job in the shell.Googling for "how to set up cron job" revealed this link at the top:http://www.adminschoice.com/docs/crontab.htmI'm sure this article will help you.P.S.As a command to execute you should put something like:/usr/local/bin/php -f <path_to_your_php_script>where the first path is the full path to your php cli executable, which may differ on your machine. You can make sure by issuing this command:which phpGood luck with cron jobs ;)
I am totally new to the subject of cron jobs so I have no idea where to start learning about them; when, why, or how to use them with my Zend Framework application, or PHP in general.Can anyone explain the process, with an example, or recommend some good resources to get started?
Getting started with cron jobs and PHP (Zend Framework)
Just use two cronjobs:*/20 8-19 * * * /your/script 0 20 * * * /your/scriptThat is:one to run every 20 minutes from 8 to 19 hoursone to run at 20.00.As a reminder, this is the format for a cronjob:+---------------- minute (0 - 59) | +------------- hour (0 - 23) | | +---------- day of month (1 - 31) | | | +------- month (1 - 12) | | | | +---- day of week (0 - 6) (Sunday=0 or 7) | | | | | * * * * * command to be executed
How to runcron jobevery day from8:00 AMto8:00 PMat 20 minutes interval eg cron job should start at8:00 AMevery day, then run at8:20 AMthen8:40 AMthen9:00 AMup to8:00 PM. Thanks.EDIT:How to Implement it with rubywhenevergem.
Cron job every day from 8AM to 8PM at 20 minutes interval
Using cronjobs is the best way.If you can't use a cronjob on your shared hosting (ask the customer support), you can run a cronjob on a machine connected to the internet (i.e. your home computer) that runs a wget to a php page on your server, authenticate on it and then run the php code to send your email.For the PHP code part I'll use a database table with all the emails to be sent, a creation_date field and a status field.Your PHP code called by the job will simply do (in pseudo code):$batchRecords = takeAbunchOfRecordsWhereStatus(NOT_SENT); while($batchRecords) { if($creationDate + 10 minutes >= now()) { sendEmail(); markRecordAsSent(); } }
I need to delay the execution of some code in PHP (for example; sending an email) by 10 minutes after an event (form submission).What is the best way to accomplish this?Would be my only option be to run a Cronjob every minute? Is this practical on shared hosting?
Execute code after a 10 minute delay in PHP
First, accordingto the documentation, it should besecond="*/30"instead ofseconds="*30/", then, theadd_cron_jobmethod prototype is:def add_cron_job(self, func, year=None, month=None, day=None, week=None, day_of_week=None, hour=None, minute=None, second=None, start_date=None, args=None, kwargs=None, **options): """ Schedules a job to be completed on times that match the given expressions. :param func: callable to run :param year: year to run on :param month: month to run on :param day: day of month to run on :param week: week of the year to run on :param day_of_week: weekday to run on (0 = Monday) :param hour: hour to run on :param second: second to run on :param args: list of positional arguments to call func with :param kwargs: dict of keyword arguments to call func with :param name: name of the job :param jobstore: alias of the job store to add the job to :param misfire_grace_time: seconds after the designated run time that the job is still allowed to be run :return: the scheduled job :rtype: :class:`~apscheduler.job.Job` """so, in your case, you should write something like this :from apscheduler.scheduler import Scheduler def job_def(var1, var2): print "%s - %s" % (str(var1), str(var2)) s = Scheduler() s.add_cron_job(job_def, args=['hello', 'there'], second='*/30') s.start()
I am trying to schedule con style job using advanced python scheduler. Everything is fine whenever I use function that does not require any parameters, however I am unable to schedule the same job passing one or more arguments. Could you please advise?from apscheduler.scheduler import Scheduler def job_def(var1, var2): print "%s - %s" % (str(var1), str(var2)) s = Scheduler() s.add_cron_job(job_def,['hello', 'there'], seconds='*/30') s.start()Error:Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/APScheduler-2.0.2-py2.7.egg/apscheduler scheduler.py", line 346, in add_cron_job start_date=start_date) File "/usr/local/lib/python2.7/dist-packages/APScheduler-2.0.2-py2.7.egg/apscheduler/triggers/cron/__init__.py", line 44, in __init__ field = field_class(field_name, exprs, is_default) File "/usr/local/lib/python2.7/dist-packages/APScheduler-2.0.2-py2.7.egg/apscheduler/triggers/cron/fields.py", line 29, in __init__ self.compile_expressions(exprs) File "/usr/local/lib/python2.7/dist-packages/APScheduler-2.0.2-py2.7.egg/apscheduler/triggers/cron/fields.py", line 56, in compile_expressions self.compile_expression(expr) File "/usr/local/lib/python2.7/dist-packages/APScheduler-2.0.2-py2.7.egg/apscheduler/triggers/cron/fields.py", line 69, in compile_expression (expr, self.name))
python: advanced python scheduler - cron style scheduling - pass function parameters
You can either useconcatfunction to concatenate the query with your dynamic content i.e., your parameters or you can use string interpolation (@{...}).Either way, you can build a dynamic query where you will be using parameters (with values as you wish).Consider, you want to build a query as specified in the comment, and have 2 parameters as shown in the below image:You can use the following dynamic content to build the query. Enclose the parameter within@{...}(string interpolation) wherever required:Declare @SourceID int, @datafileid int; Set @SourceID=@{pipeline().parameters.source_id}; Set @datafileid=@{pipeline().parameters.datafield}The above would generate the query as shown in the below image:You can either directly use similar dynamic content wherever you are using the query or store the value in aset variableactivity and use that variable in place of query.
I have SQL dynamic query with a "?" that needs to be replaced with pipeline parameters. The fetched query has a question mark "?" how to replace that?I tried passing the parameters but ADF doesn't recognize the ? symbol and the correct parameters are not passed
SQL dynamic query in ADF
Airflow DAG is defined through Python code. So you can create your own DSL that is generated from the GUI-designed DAG. Then you can write Python code that generates Airflow DAG from your DSL document.Another option is to usetemporal.ioopen source orchestrator that allows you to write an interpreter for any custom DSL directly in a programming language of your choice without converting it to an intermediate representation.
I am looking for a technique that I can build and control DAG's tasks from GUI, to allow the end user to create its own DAGs or control some tasks inside a DAG.I've tried Apache Airflow, It's really nice, but I couldn't create a custom DAG from the GUI that includes predefined tasks.
How can I use Apache Airflow to build dynamic DAGs using the GUI?
The solution was to install in the new machine the proper SDKs. I have to install all following SDKs.The correct SDK versions depends on your project.
I have installed a new Azure agent in a new machine.I have tried the following pipelineI have problems wit the Use Nuget showing the next error:Unable to get local issuer CertificateWhat could be the problem?
Azure nuget installer and nuget Restore fails in pipeline running in a new machine agent
I was not aware of blacklist/whitelist concept in GoCD. So using blacklist over config-repo solved my problem.
GoCD config-repo schedules pipeline on change in pipeline code but I only want that pipeline to trigger via change in specified material of the pipeline.Any solutions to this problem?
GoCD config-repo schedules pipeline on change which I don't want
I´m actually using Airflow to run etl-pipelines with similar steps described by you. The whole workflow can be partitioned into single tasks. For almost every task Airflow provides an operator.Forlook at ftp if new csv files existu could use a file sensor with underlying ftp-connectionFileSensorForif yes than donwload themyou could use the BranchPythonOperator.BranchPythonOperatorAll succeding tasks could be wrapped into a .py function and then be executed via the PythonOperator.Would definitely recommend using Airflow, but if you are looking for alternatives, there are plenty:airflow-alternatives
i am writing a very simple ETL(T) pipline currently:look at ftp if new csv files existif yes than donwload themSome initial Transformationsbulk insert the individual CSVs into a MS sql DBSome additional TransformationsThere can be alot of csv files. The srcript runs ok for the moment, but i have no concept of how to actually create a "managent" layer around this. Currently my pipeline runs linear. I have a list of the filenames that need to be loaded, and ( in a loop) i load them into the DB.If something fails the whole pipeline has to rerun. I do not manage the state of the pipleine ( i.e. has an specific file already been downloaded and transformed/changed?). There is no way to start from an intermediate point. How cold i break this down into individual taks that need to be performedßI rougly now of tools like Airflow, but i feel that this is only a part of the necessary tools, and frankly i am to uneducated in this area to even ask the right questions.It would be really nice if somebody could point me in the right direction of what i am missing and what tools are available. Thanks in advance
Python and ETL: Job and workflow/task mamangent trigger and other concepts
If you use self-hosted agent, you can try to manually build this project again. See if you have same error or not.
Android Azure Devops pipeline getting error while running BUILD FAILED"Error: The process '/Users/runner/work/1/s/main/gradlew' failed with exit code 1"At locale system everything working and apk generated but when run pipeline at azure devops it showing the errorCode analysis failed. Gradle exit code: -1. Error: Error: The process '/Users/runner/work/1/s/main/gradlew' failed with exit code 1I am already using Java 11.Please help me out.I searched a lot for the same but not get any solution.
Azure Devops pipeline getting error while running BUILD FAILED "Error: The process '/Users/runner/work/1/s/main/gradlew' failed with exit code 1"
I resolved this using below shell command -pipeline_definition_json=$(aws s3 cp "s3://$S3_BUCKET/<folder_1>/sagemaker_pipeine_definition.json" - | tr -d '\n') aws sagemaker update-pipeline --pipeline-name $PIPELINE_NAME --role-arn $ROLE_ARN --pipeline-definition "$pipeline_definition_json"
Im trying to integrate Sagemaker pipeline with Jenkins. Im using aws-cli ( version - 2.1.24 ).Since this version doesnt support--pipeline-definition-s3-location, Im trying to do something like below -aws s3 cp s3://some_bucket/folder1/pipeine_definition.json - | \ jq -c . | \ tee /dev/stderr | \ xargs -0 -I{} aws sagemaker update-pipeline --pipeline-name "pipelinename" --role-arn "arn:aws:iam::<account_id>:role/sagemaker-role" --pipeline-definition '{}'And I found this error - An error occurred (ValidationException) when calling the UpdatePipeline operation: Pipeline definition: At least 1 step must be providedWhen I recheck the definition.json, Im able to see the steps defined inside json.Can someone help me?I tried adding the quotes for --pipeline-definition, which isnt working.Since jenkins has aws-cli 2.1.24 version, I want to someone copy the contents of json file in s3 and pass it to --pipeline-definition argument using aws sagemaker --update-pipeline command.
AWS Sagemaker pipeline definition error while running from aws-cli
Unfortunately, you cannotbatchyet with the data source API. However, the underlying client do support batch:@Inject Redis redis; // ... redis.batch(List.of(req1, req2, req3));
I'm facing an issue with the Redis connection pool, reaching the max wait queue size, at moments with more reads. There are some reads in a loop that would be good to batch in one request to Redis. But I cannot find a way to use Redis pipelines with Quarkus Redis Client. Is there a way to do it?Here is my Redis service:public class CacheService { private final HashCommands<String, String, CachedData> redisHash; protected CacheService(RedisDataSource redis) { this.redisHash = redis.hash(CachedData.class); } protected CachedData get(String name) { return redisHash.hget("data", name); } }And here are the multiple reads in a loop that can be done with pipelines:names.stream().map(cacheService::get).toList();How I can use Redis pipelines with Quarkus?
Redis pipelining in Quarkus
I've done the following because with Groovy I couldn't do it. I installed "Build Name and Description Setter" plugin. In the "ProjectLaunch" pipeline project, the pipeline would be more or less like this:Pipeline { agent any parameters{ string(name: "DESCRIPTION", defaultValue: "ProjectCalled full launched", description: "") } stages { stage('ProjectCalled') { steps{ build job: 'ProjectCalled', parameters: [string(name: "DESCRIPTION", value: params.DESCRIPTION)] } } }}And in the ProjectCalled in settings, add a parameter, I select the plugin option Changes build description, and I write ${DESCRIPTION}.Changes build descriptionAh!, I have also created string parameter named DESCRIPTION and without value.String parameter
Hello: I have a pipeline project at Jenkins called "ProjectLaunch" that launches other projects automatically one day a week. I would like to show in "Edit Build Information" a text that says something like "ProjectCalled full launched", in the project that is called. With the pipeline I have in "ProjectLaunch" I can only get that text in its "Edit Execution Information" but not in the projects called.My pipeline:pipeline { agent any stages { stage('Proyect called') { steps{ build job: 'Proyect called',string(name: "DESCRIPTION", value: "ProjectCalled full launched") ] } } } }In the project called in the configuration I have an Execute system Groovy script, it is this:import hudson.model.* def build = manager.build def params = build.action(hudson.model.ParametersAction).getParameters() def description = "${params.DESCRIPTION}" echo "Setting build description to: ${description}" build.createSummary("Build description").appendText(description, "html")But when I launch it I get this error: Caught: groovy.lang.MissingPropertyException: No such property: manager for class: hudson1130775177255181016 groovy.lang.MissingPropertyException: No such property: manager for class: hudson1130775177255181016Any ideas? Thank you.
How to display in a project that is called from another pipeline project in jenkins text in "Edit Build Information"
This is pretty common mistake, I think you have not restarted you Elasticsearch server and the new changes of elasticsearch.yml is not loaded.If its not resolved after restart then share your config file. Will have to take a look at it.
enrich.fetch_size- Maximum batch size when reindexing a source index into an enrich index. Defaults to 10000.When the value is changed inelasticsearch.ymlto ex. 20000, the error appears when executingingest policy{ "error" : { "root_cause" : [ { "type" : "illegal_argument_exception", "reason" : "Batch size is too large, size must be less than or equal to: [10000] but was [20000]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting." } ], "type" : "search_phase_execution_exception", "reason" : "Partial shards failure", "phase" : "query", "grouped" : true, "failed_shards" : [ { "shard" : 0, "index" : "name-of-index", "node" : "node-id", "reason" : { "type" : "illegal_argument_exception", "reason" : "Batch size is too large, size must be less than or equal to: [10000] but was [20000]. Scroll batch sizes cost as much memory as result windows so they are controlled by the [index.max_result_window] index level setting." } } ] }, "status" : 400 }config file:... discovery: seed_hosts: - "127.0.0.1" - "[::1]" - elasticsearch script: context: template: max_compilations_rate: 400/5m cache_max_size: 400 enrich: fetch_size: 20000 ...
Can the value of the enrich.fetch_size Elasticsearch parameter be increased somehow?
There is apparantly a new feature from scikit-learn 1.0 where we extract the feature names as:pipeline[:-1].get_feature_names_out()
I have a sklearn pipeline with two steps (a columntransformer preprocessor with a One hot encoder and a randomforestregressor estimator). I would like to get the feature names of the encoded columns after One hot encoding. My pipeline looks like this.categorical_preprocessor = OneHotEncoder(handle_unknown="ignore")# Model processor preprocessor = ColumnTransformer( [('categorical', categorical_preprocessor, categorical_columns)], remainder="passthrough") est = RandomForestRegressor( n_estimators=100, random_state=0) pipe = make_pipeline(preprocessor,est)I am trying to get the feature names of the encoded columns like this:pipe['preprocessor'].transformers[0][0].get_feature_names(categorical_columns)But I get an error.'str' object has no attribute 'get_feature_names'
Extracting feature importances along with column names from sklearn pipeline
I know it's late now. but lately I realized that I didn't post the answer which figured out by myself. Conclusion is: you can not set default branch as planned branch in any of the property of pipeline.java. Since by default it consider default branch of bamboo repository as planned branch for bamboo pipeline. And if you want to set some different branch in bamboo pipeline.java file, you can do it by newDeploymentTrigger().setArtifactBranch("<planned_branch_name>")
Default branch in Bamboo spec is master for the repository. At the time of Auto deployment trigger, Bamboo specs deploying master branch only, but sometimes even if default branch is updated to feature branch, I want to trigger master only.I am able to set any feature branch other than master.But I am not able to set master branch explicitly in Pipeline.java file.It gives Bamboo Specs error stating "Scheduled trigger: Can't find triggering branch 'master'"
Error in Bamboo Specs while triggering build plan for master branch
Actually,quotesaround your conditionare important!It should be:workflow: rules: - if: '$CI_COMMIT_BRANCH == "master"' when: alwaysIt's weird because quotes are inconsistent in GitLab docs, they're here in one section, but disappear in another. Anyway, add quotes, don't ask questions.
I did set up a CI on a GitLab (version 15.7.0), and I'm trying to run a pipelineonlyif a commit has been made onmasterbranch, first.The pipeline should only run only when a commit is made on master branch, but It's not. It runs for any commit pushed to any branch.That's what I put in thegitlab-ci.yml:default: image: python:3 cache: paths: - ".cache/pip" workflow: rules: - if: $CI_COMMIT_BRANCH == "master" # Also tried with $CI_DEFAULT_BRANCH when: always stages: - prerequisites - pytest variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" prerequisites: stage: prerequisites needs: [] script: - python --version - pip install pytest pytest: stage: pytest needs: ["prerequisites"] script: - python -m pytest -v tests/I assumed I don't have to specify- when: neverto cover other cases because the documentation states:pipelines donotrun in any other case.-Ref
Jobs run despite workflow rules
Take a lookup activity in Azure data factory/ Synapse pipeline and in source dataset of lookup activity, take the table that has the required parameter details.Make sure to uncheck thefirst row onlycheck box.Then take the for-each activity and connect it with lookup activity.In settings of for-each activity, click add dynamic content in items and type@activity('Lookup1').output.valueThen you can add other activities like switch/if inside the for-each activity.
I'm working on an ETL pipeline in Azure Synapse.In the previous version I used an Array set as a parameter of the pipeline and it contained JSON objects. For example:[{"source":{"table":"Address"},"destination {"filename:"Address.parquet"},"source_system":"SQL","loadtype":"full"}}]This was later used as the item() and I used a ForEach, switch, ifs and nested pipelines to process all the tables. I just passed down the item parameters to the sub pipelines and it worked fine.My task is now to create a dedicated SQL pool and a table which stores parameters as columns. The columns are: source_table, destination_file, source_system and loadtype.Example:source_tabledestination_filesource_systemloadtype"Address""Address.parquet""SQL""full"I don't know how to use this table in the ForEach activity and how to process the tables this way since this is not an Array.What I've done so far: I created the dedicated SQL pool and the following stored procedures:create_parameters_tableinsert_parametersget_parametersThe get_parameters is an SQL SELECT statement but I don't know how to convert it in a way that could be used in the ForEach activity.CREATE PROCEDURE get_parameters AS BEGIN SELECT source_table, destination_filename, source_system, load_type FROM parameters ENDAll these procedures are called in the pipeline as SQL pool stored procedure. I don't know how to loop through the tables. I need to have every row as one table or one object like in the Array.
ForEach activity to loop through an SQL parameters table?
You can use the-MaxMessageSizeInKilobytesparameter for theSet-AzServiceBusQueueCmdLet to specify a maximum message size in a ServiceBus Queue.Set-AzServiceBusQueue -ResourceGroupName myResourceGroup -NamespaceName myNamespace -Name myQueue -MaxMessageSizeInKilobytes 100Seethe docsfor details.
I have a custom task in an Azure DevOps release pipeline that creates topics and queues. It works but giving the PowerShell script a list of the queues or topics to be made, that the script then uses to set everything up on an existing Azure Service Bus.I recently had to set up a Service Bus with queues that could handle messages up to 100MB, but couldn't find a way to make the script support this. I ended up having to change message sizes manually for all new queues, which was tedious.Looking online, I still can't find a way to change max message sizes when setting up queues through script. Am I missing something, or is this not possible?I've looked several places online without finding anything helpful. Most links refer to setting the max queue size, which is not what I'm after. I need to set the max size for the messages themselves.
Is it possible to set the max size of individual messages when creating a Service Bus queue through PowerShell?
The "Caused by" gives you the answer: the configured database host is unknown!Either because you have a typo in the configuration ("hoost" instead of "host"), the respective machine is (was) currently offline, or the (local) DNS has (had) lost the name of the machine. Another option is that someone renamed the database host (that would be similar to the typo, only that it was not really your fault).Determine which options (maybe there are more …) fits to your situation and fix it.
I'm facing oracle database connectivity issue while running my automation script thru jenkins pipleline whereas it is working fine when I run the script in local.Error Log:java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connectionCaused by: java.net.UnknownHostException: *********: Name or service not knownAfter googling it, able to understand that there could be a reason one among of these. firewall blocking, port disabled or proxy issue but not sure how to confirm it.Please help me how to fix this issue.Thanks,Karunagara Pandi G
Getting 'java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection' while connecting oracle database
In order to execute commands on a different server, you need to first connect to it. For example, you can SSH into the remote machine and execute the commands there. You can use something likeSSH Stepfor this.def remote = [:] remote.name = 'test' remote.host = 'test.domain.com' remote.user = 'root' remote.password = 'password' remote.allowAnyHosts = true stage('Remote SSH') { sshCommand remote: remote, command: "docker-compose up -d" }Another option is to add the remote server as a Jenkins agent and execute the command on the remote Agent. For this you can change the agent directivepipeline { agent {label: "server2" ......
I got a task to create a pipeline on Jenkins which make a pull and up -d on docker compose on another workspace, another server. Just Jenkins is on 172.16.0.x and i have to run this pipeline on another server 172.16.0.x. I heard something about change the header '-URL' where POST is going. Can u help me guys where i can change it or how i can solve that ? I'm looking for and can't find anything. :( My pipeline:pipeline { agent any stages{ stage('Update_docker'){ steps{ bat "docker-compose pull" bat "docker-compose up -d" } } } }When i running that pinepline on localhost everything going success.
How to run pipeline from Jenkins to another adress
the syntax is:file_format = (type = 'CSV')However, as CSV is the default, you can leave this out entirely
create or replace stage AWS_OWNER1 url = 's3 url' credentials = (aws_key_id = 'aws_key_name' aws_secret_key = 'aws_secret_key') file_format = CSV;when i run above query i will get error as "SQL compilation error: File format 'CSV' does not exist or not authorized."please send valied answer to solve this issue.Thank You
not able to create stage in snowflake
I have fixed my stored procedure by changingWHEN [Intercompany].[DisplayValue] = ''toWHEN ISNULL([Intercompany].[DisplayValue], '') = ''which now allows me to store theNULLvalues too. I made a mistake when I looked up theInterCompanytable there was noNULLvalue but I missed the part that I have someJOINs which may createNULLvalues.
I am running a pipeline that calls a stored procedure and sinks the table to another dedicated pool. I made sure that in the source table I have no NULL VALUES in intercompany table (I have named a field in sink table as Intercompany too), so I'm not really sure why I am getting this error.Message=Column 'Intercompany' does not allow DBNull.Value.,Source=System.Data
Column does not allow DBNull.Value - Synapse
If there is substantial filtering, windowing after the filter will technically reduce the amount of work performed, though that saved work is cheap enough that I doubt it'd make a measurable difference. (Presumably the runner could notice that the filter does not observe the assigned window and lift it in that case, but as mentioned it's unclear if there are really savings to be gained here...)
I'm developing one pipeline that reads data from Kafka.The source kafka topic is quite big in terms of traffic, there are 10k messages inserted per second and each of the message is around 200kBI need to filter the data in order to apply the transformations that I need but something I'm sure is if there is an order in which I need to apply the filter and window functions.read->window->filter->transform->writewould be more efficient thanread->filter->window->transform->writeor it would be the same performance both options?I know that samza is just a model that only tells the what and not the how and the runner optimizes the pipeline but I just want to be sure I got it correctThanks
What is the correct way to organize the ptransforms in a beam pipeline?
As a Kubernetes resource in an environment is referencing Kubernetes service connection, you can use thisAPIto list theserviceEndpointIdof a Kubernetes resource, which is also theresourceIdof the referenced service connection.GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}/providers/kubernetes/{resourceId}?api-version=7.0Applied with the value of theserviceEndpointIdfrom the response of the above API, we can proceed to use thisAPIto get the referenced service connection details.GET https://dev.azure.com/{organization}/{project}/_apis/serviceendpoint/endpoints/{endpointId}?api-version=7.0
During a pipeline run, under deployment job, providing a deployment environment eliminates the need of providing service connection manually. I'd guess, it's either creating a new SC at this time or it would have created SC at the time of environment creation and using the same. Either ways, is there a way to find out which Service connection is being used from the logs of pipeline run or from anywhere else? In our environment, I see a lot of service connection for one environment and a cleanup is necessary to get things in place.I tried giving SC manually along with environment and it works as expected. So, going forward, I can use this method. But for cleanup, I'd still like to know which one gets used when not specified! (none of the auto-created SCs show any execution history, but I know the deployment has happened multiple times)
How to find the auto-created service connection when deploying to AKS
To run selenium cucumber project in GitLab, we need to setup this .gitlab-ci.yml file under the root folder. Use the below configuration in .gitlab-ci.yml file.image: maven:3.8.3-openjdk-17 cache: paths: - .m2/repository/ - target/ build: stage: build script: - mvn compile test: stage: test script: - pwd - mvn testMakes sure you have used the below plugin in pom.xml file,<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>8</source> <target>8</target> <debug>true</debug> <debuglevel>lines,vars,source</debuglevel> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M4</version> <configuration> <includes> <include>**/RunCukes*.java</include><!-- specify your runner file here --> </includes> <testFailureIgnore>true</testFailureIgnore> </configuration> </plugin> </plugins> </build>Note: While running the pom.xml as maven test in your local IDE it should trigger the cucumber runner file
I facing the below error while running the selenium cucumber project in GitLab pipeline, using .gitlab-ci.yml configuration[ERROR] Failed to execute goal on project Samplemaven: Could not resolve dependencies for project org.example:Samplemaven:jar:1.0-SNAPSHOT: Failed to collect dependencies at io.cucumber:cucumber-java:jar:7.2.3: Failed to read artifact descriptor for io.cucumber:cucumber-java:jar:7.2.3: Could not transfer artifact io.cucumber:cucumber-java:pom:7.2.3 from/to central (http://repo.maven.apache.org/maven2): Connection reset -> [Help 1]
how to configure selenium cucumber framework in GitLab pipeline using gitlab-ci.yml configuration file
Is there a specific reason why you don't want to use a GitLab webhook? Webhooks are the common way to start builds from SCM. GitLab also has official documentation on how you can achieve your goal using webhooks:https://docs.gitlab.com/ee/integration/jenkins.htmlThe tutorial covers all the steps end to end from creating access tokens to allow Jenkins to access your repo, to setting up the webhook which will be responsible for triggering the builds.If you do not want to use webhooks, you can use a longer method to trigger your builds when a PR is created. You will need to first create a polling Job in Jenkins that runs every couple of minutes and calls the GitLab Merge requests API (doc). Get all the open PRs, which will be potential candidates for a build. Since you don't want to build a PR that has already been built, you will need to get the latest commit in a PR (doc).Then, check if that commit has been already built. If not, trigger a downstream job that builds the commit. Once the build finishes, make sure to update the build status for the commit saying that it has been built so that it doesn't get built again.As you can see, it is a roundabout method, but it is your best option without using webhooks.
I don't want to use the webhook option in Gitlab. also the Jenkins job should be automatically triggered when the pull request is created.i Tried as per this -https://about.gitlab.com/handbook/customer-success/demo-systems/tutorials/integrations/create-jenkins-pipeline/This only showing gitlab pipeline error but no jenkins job is triggering.
How can we set, to trigger a Jenkins job when a Pull request is created from Gitlab using Jenkinsfile
You could use either protocols to transer files/artifact if that is what you are asking.
As the title says, I am curious to know if the protocol being used would typically be FTP or if HTTP is sufficent.What protocol would you use, if you were to build your own pipeline, to transfer the file fromversion control -> server(s) making up pipeline -> server receiving and running the artifact.Maybe I'm overthinking/overcomplicating, and HTTP is the protocol being used to transfer the artifact?I've searched around for any answers, but not found any information regarding what protocol is typically being used.
What network protocol would a typical CI/CD pipeline use?
This looks like an error whereencoderis aColumnTransformerexpecting apandasdataframe.pipe.predictis looking for a column namedsex, but not finding one.For example, this:from sklearn.pipeline import Pipeline from sklearn.preprocessing import OneHotEncoder from sklearn.ensemble import RandomForestClassifier from sklearn.compose import ColumnTransformer import pandas as pd df = pd.DataFrame({ "zero": ["A", "B", "C", "A", "B", "C"], "one": [1, 1, 2, 1, 2, 1], "two": [0.5, 0.3, 0.2, 0.1, 0.9, 0.7], "label": [0, 0, 0, 1, 1, 1]}) encoder = ColumnTransformer( [('ohe', OneHotEncoder(), ["zero", "one"])], remainder="passthrough") X, y = df.drop(["label"], axis=1), df["label"] pipe = Pipeline([('ohe', encoder), ('clf', RandomForestClassifier())]) pipe.fit(X, y) pipe.predict([["A", 1, 0.5]])Results in (scikit-learn==1.2.0):ValueError: Specifying the columns using strings is only supported for pandas DataFramesBut switching to:X_test = pd.DataFrame([["A", 1, 0.5]], columns=["zero", "one", "two"]) print(pipe.predict(X_test)) # [0]
From what I found out when trying myself and reading here on stackoverflow, When I pass a pandas dataframe to .predict(), it successfully gives me a prediction value. Like below:pipe = Pipeline([('OneHotEncoder', encoder), ('RobustScaler', scaler),('RandomForestRegressor',RFregsr)]) pipe.fit(X_train, y_train) with open('trained_RFregsr.pkl','wb') as f: pickle.dump(pipe, f) test = pipe.predict(X[0:1]) print(test) >> [10.82638889]But when I try to pass in a list of all input values required, 25 in my case, it returns a key error. This is related to how pandas dataframe only returns column names when iterated, and not the values.test = pipe.predict([['M', 15, 'U', 'LE3', 'T', 4, 3, 'teacher', 'services', 1, 3, 0, 'no', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 5, 4, 4, 2, 15, 16]]) print(test) >> KeyError : 'sex'I have trained a model using 25 values consisting of categoricals and numerical values to predict a single int value. As to why I am pickle-ing the file, I have to deploy it using FastAPI and it has to receive input from API endpoints. If required I can post complete code somewhere. Please tell me how I can safely pass a list of required inputs so that the model can predict on them?EDIT: This is how I have used the OneHotEncoder:import category_encoders as ce encoder = ce.OneHotEncoder() x_train = encoder.fit_transform(X_train) x_test = encoder.transform(X_test)
Key Error when passing list of input in .predict() using Pipeline
The best way (in my opinion) is to pass in these values using an environment variable. You can then reference them using${__P("user_name", "anonymous")}The__Pfunction is a shortcut for the__propertyfunction:https://jmeter.apache.org/usermanual/functions.html#__propertyThe first parameter is the name of the environment variable, the second is the value to use if that environment variable is not actually set.If you don't want to use an environment variable, You can also pass the value in from the command line using the -J option:jmeter -Juser_name="Johnny" -Jpassword="secret"The values are accessed in the same manner using the__Pfunction.
I am bit new to Jmeter and in performance testing world. I am bit strugling with best practises with test data where user id and password is saved in .csv file.I know it is not good parcise to have user id and password in srouce code respository. But how to manage test data if I want to used 10 use id and passowrd for logins in my Jmeter script. I have plan to run these test in pipeline?Any sugestion?
What is best practises to managed Jmeter script with csv file with usere id and password?
Tip: I see you use the Kubernetes plugin. Have you seen the section ofinheritance? Using the declarative pipeline syntax, withinheritFrom, might provide a much cleaner way to achieve the wanted results. Here we also keep theyamlMergeStrategyas default (override()).I have seen that the indents of the "delta yaml" (yaml_config), provided toyaml:, influences the final outcome (trailing and starting newlines could also have impact). So I would recommend testing with ayaml_configlike:yaml_config = """ spec: tolerations: - key: "my_toleration" operator: "Equal" value: "value1" effect: "NoSchedule" """
I have the following code in groovy:void call(Closure closure) { pod_template_maven_image = ... pod_template_maven_m2 = ... pod_template_nodejs_image = ... pod_template_sonar_image = ... toleration_condition = true def yaml_config = "" if(toleration_condition){ yaml_config = """ spec: tolerations: - key: "my_toleration" operator: "Equal" value: "value1" effect: "NoSchedule" """ } podTemplate(containers: ..., volumes: ..., etc..., yaml: yaml_config, yamlMergeStrategy: merge()) { node(POD_LABEL) { closure() } } }At the moment, when I run the job in jenking nothing happens, the pod is created whitout error. But the yaml is not added in pod.We want to add the toleration (yaml_config) in podTemplate depending of toleration_condition value.I'm new in this area and don't now if is possible. Its is? Whats the best way to do it?Thanks.
How merge yaml in podTemplate?
Update 22.12.2023I was wrong. If python is installed on the node, where the parameter is executed, you can do something like:choiceParameter { name('pythonParams') description('Select parameter from the dropdown list') choiceType('PT_SINGLE_SELECT') filterable(false) filterLength(0) randomName(null) script { groovyScript { script { script(""" def parametersFromScript = ['/usr/bin/python3', "path/to/your-script.py"].execute() return parametersFromScript """) sandbox(true) } fallbackScript { script("return ['ERROR: Could not get parameters']") sandbox(true) } } } }Note: The user, that is running this script, needs access to the python binary and script.I never seen something like this. I think, you cannot call python directly form inside parameter script as it is running in a sandbox. So you can only execute groovy code there. But what you can do in the parameter scripts is making HTTP requests.I would suggest deploying your python code as a little service and calling it via API. Like describedhere.If you want your groovy code do be versioned as well I would suggest parameter script in declarative pipeline likehttps://stackoverflow.com/a/45477285/5138605.
I would like to run a python script to gather list of data and then use is as my dropdown values. Is it possible to run such a script with opening jenkins job? So the user will see dynamically set dropdown outputs? Now I have all dropdowns added manually, but would have to change configuration every time when one of the options is changed or added. Is there available plugin to gather this data every time?
Jenkins - run script to set dropdown parameters
I don't know why, so please check them one by one.Is this a Render Pipeline Asset for 2D?Have you set it to Quality setting?Did you set it to Graphics setting?Is the Camera's Renderer specified as Default Renderer or 2d's Renderer Pipeline?
My project uses the URP lights that were well configured, but a while ago they stopped working, they even disappeared in the menu, the lights that are in the scene do not work and there is the following error: "error 2d renderer data must be assigned to your urp asset or camera". I am not able to fix this error.No URP lights, and the lights error is global or normal that already had in the projectIt has URP lights, but it doesn't let you add itURP configurationURP configurationI have already reinstalled the URP and configured it again and the problem persists.
URP lights are not working in unity, they first worked
When you trigger a job inside a pipeline, you use thebuild jobstep. This step has a property calledpropagatethat:If enabled (default state), then the result of this step is that of the downstream build (e.g., success, unstable, failure, not built, or aborted). If disabled, then this step succeeds even if the downstream build is unstable, failed, etc.; use the result property of the return value as needed.You can write a wrapper for calling jobs, that stores the result of each job (and maybe other data useful for debugging, like build url), so you can use it later to construct the contents of an email. E.g.def jobResults = [:] def buildJobAndStoreResult(jobName, jobParams) { def run = build job: jobName, parameters: jobParams, propagate: false jobResults[jobName] = [ result: run.result ] }Then you can constuct the body of an email by iterating through the map e.g.emailBody = "SUMMARY\n\n" jobResults.each() { it -> ​ str += "${it.key}: ${it.value.result}\n" }And use themailstep to send out a report.It's worth thinking if you want your pipeline to fail after sending the email if any of the called jobs failed, and adding links from your email report to the failed jobs and caller pipeline.
In my company I have a pipeline that runs several jobs. I wanted to get the result of each job and write each of these results in a file or variable, later email it to me. Is there such a possibility? Remembering that: I don't want the result of the pipeline, but the result of each of the jobs that are inside it.I even tried to make requests via api, but for each pipeline it would have to have a code and that is not feasible at all, the maintenance issue.
Result of each jenkins job and send by email
You can use a powershell task and use Convertfrom-Json command$Json = @' { "Friends": [ { "Name": "John", "Phone": "12345678" }, { "Name": "Frank", "Phone": "12235578" }, { "Name": "Bill", "Phone": "13790678" } ] } '@ $result = $Json | ConvertFrom-Json $result.Friends[0].Phone='12345' $result | ConvertTo-Json -Depth 4This will change 'John' phone number. Answer 2:$result = $Json | ConvertFrom-Json $result.Friends | % {if($_.name -eq 'john'){$_.phone=98765}} $result | ConvertTo-Json -depth 10
We are running a build pipeline in azure DevOps. After the build we deploy the stuff and substitute variables in JSON files. I have a problem substituting a variable in a list of equal objects. My son looks like this:"Friends": [ { "Name": "John", "Phone": "12345678" }, { "Name": "Frank", "Phone": "12235578" }, { "Name": "Bill", "Phone": "13790678" } ]I can substitute Franks phone using the path: Friends.1.PhoneWhat should I do, if the order of "Friends" is not determined and I can not use the index?I searched for the azure plugin "variable substitution condition" but I couldn't find any useful task.
Azure Devops : Replace variable in list with unknown order
Figured out we can use Get-WindowsFeature and use properties Parent,DependsOn to create a matrix to remove all Features installed from one feature.
We have configued GitLab and Ansible to trigger Windows Server creation, we implemented adding windows features, adding and removing windows features is configured in yaml;Windows-Feature - SMTP-serverWe have successfully managed to create logic for Installing and uninstalling features using powershell, however, we see that whenever we uninstall, there are still alot of dependencies of spesific Windows Feature installed, For example; installing SMTP-server, installs dependencies; RSAT,RSAT-Feature-Tools,RSAT-SMTP,Web-WebServer etc etc. Removing 'SMTP-server' still keeps the dependencies installed, which is an issue.Is there any lifecycle managent system or sollution that can manage Uninstallation of all dependencies for Windows Features for pipelines ?We tried; (Get-WindowsFeature -Name 'SMTP-Server').DependsOn | Uninstall-WindowsFeature with while loops, issue is that (Get-WindowsFeature -Name 'SMTP-Server').DependsOn does not return all dependencies even if we try lopping through with while loop on nested DependsOn.Graph theory,Dependencies Tree Implementation, but there are no clear techincal sollution for this in Powershell or Ansible.We have looked athttps://docs.ansible.com/ansible/latest/collections/ansible/windows/win_feature_module.htmlbut it is the same issue with the ansible module as well. If we use parameter state with value present, then change the parameter state to value absent, the dependencies is still installed.
How to Remove\Uninstall all Windows Server feature dependencies for a Windows Feature using ansible\powershell\lifecycle management system
Not sure whether you are using git. However our preferred way to do this is by using theshstep on both Linux and Windows:We do this by using the bash/sh which comes with Windows git. You just need to ensure that it (sh) is in the path (if e.g. you do a manual install git will even ask you to add its command line tools to the path). For the Jenkins nodes you may want to add this to your Jenkins node configuration.One alternative we use is a wrapper function which you may specify somewhere in your Jenkinsfile or in a Pipeline library. It may look something like this:def executeCmd(def args) { if (isUnix()) { sh args } else { bat args } }Please note that this obviously can only handle cases where the arguments would be 100% identical on Windows and Linux.Therefore I would recommend to useshon Windows and Linux.Or if you prefer you may want to Powershell on Linux and use thepwshstep instead.
I am developing a declarative pipeline on Jenkins and one of the requisites is that it must work for both Windows and Linux.Right now, to achieve this I am making use of two stages, one for Linux environment and the other one for Windows environment, as it is possible to see in the code belowstage('Integration Tests on Windows') { when { expression { env.OS == 'BAT' }} steps { dir('') { bat 'gradlew.bat integrationTest' junit '**/build/test-results/integrationTest/*.xml' } } } stage('Integration Tests on LINUX') { when { expression { env.OS == 'UNIX' }} steps { dir('') { sh 'gradlew integrationTest' junit '**/build/test-results/integrationTest/*.xml' } } }I was wondering if there is a better way to do this while keeping the pipeline declarative?
Jenkins pipeline - How to make a stage work for both Windows and Linux
I was not thinking and ran the Unit Tests separately from the build itself so the appxrecipe files were not present.To have the tests run I had to use:- task: VSTest@2 displayName: Unit Tests inputs: platform: 'x64' configuration: '$(BuildConfiguration)' testSelector: 'TestAssemblies' testAssemblyVer2: | # Required when testSelector == TestAssemblies **\Release\ProjectName.UWP.Test.build.appxrecipe **\Release\ProjectName.DataAccessUWP.Test.build.appxrecipe **\Release\ProjectName.DataUWP.Test.build.appxrecipe !**\*TestAdapter.dll !**obj** searchFolder: '$(Build.SourcesDirectory)' resultsFolder: '$(System.DefaultWorkingDirectory)TestResults'
I'm pretty new to Azure DevOps and I am trying to get it to run the Unit tests (MSTest) as part of the pipeline. I'm using the default generated yaml for UWP. According to the documentation for unit tests I should have something like:- task: VSTest@1 displayName: Unit tests inputs: testAssembly: '**/*test*.dll;-:**\obj\**This is a high level of the file structure in question (relative to the yaml file):Pipeline.yml Project (folder) Project.sln ProjectDatabase (folder) bin (folder) obj (folder) ProjectDatabase.csproj ProjectDatabase.Test (folder) bin (folder) obj (folder) ProjectDatabase.Text.csproj ProjectDataAccess (folder) bin (folder) obj (folder) ProjectDataAccess.csproj ProjectDataAccess.Test (folder) bin (folder) obj (folder) ProjectDataAccess.Test.csprojEach time I've tried varying the path but running the Pipeline just returns:##[warning]No test assemblies found matching the pattern: '**/**/*test*.dll;-:**\**\obj\**'.Am I even going down the right path and if so, am I missing something? Thanks in advance and I greatly appreciate any assistance.
Azure DevOps Pipeline - Configure Unit Tests for UWP Project
An error saying that there are cycle dependencies.The cause of this issue could be that there are cycle dependencies in the dependencies set by your jobs.For example: Job_1 depend on Job_2 , Job2 depend on Job_1.Based on your requirements, you can reset the following dependencies to fix this issue.Job2 depend on Job 1 and Job 3 depend on Job 1 and Job 2.In this case , the job_2 will run depend on the result of Job_1 and the Job_3 will depend on the result of job_1 and job_2.YAML sample:jobs: - job: job1 - job: job2 dependsOn: job1 - job: job3 dependsOn: - job1 - job2Classic Sample:Job_1Job_2Job_3
Within an Azure Pipeline, I have an agent job called "job_3" which I want to run if it fulfills the following conditions:If Job_1(agent job) is successful orIf Job_1(agent job) fails but Job_2(agentless job) succeeds. Job_2 runs only if Job_1 fails.To start Job_3 in the pipeline I used custom variable expressions for it to trigger:The expression I used:and( eq(dependencies.Job_1.result,'Succeeded'), eq(dependencies.Job_2.result,'Succeeded') )I get an error saying that there are cycle dependencies. What can i do to mitigate the issue?
Enabling An AgentJob to run Depending on a previous agent and agentless job in Azure Devops
Thanks joe clay,Now it is working fine.After adding below code in sonar-project.js"sonar": "node sonar-project.js" "test": "echo "Error: no test specified" && exit 1"Thanks for your response it was so much helpful.
I got error npm ERR! Missing script: "sonar" while executing jenkins pipeline job with sonarqube and jenkins integration. Below is the error details.Please anyone got how to solve this error. thanks in advance.C:\ProgramData\Jenkins\.jenkins\workspace\sonarqube-pipeline>npm run sonar npm ERR! Missing script: "sonar" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: npm ERR! C:\Windows\system32\config\systemprofile\AppData\Local\npm-cache\_logs\2022-11-25T12_42_55_010Z-debug-0.log
How to resolve npm ERR! Missing script: "sonar" while executing npm run sonar
At last I used powershell script to do this.withEnv(["param=$param", "param2=$param2"]){ powershell ''' [xml]$xmlContent = Get-Content ./path/file.xml foreach ($endpoint in $xmlContent.node.endpoint) { if($endpoint.name -eq "$env:someVar"){ $lines = get-content ./path/file.xml $lines | foreach-object {$_ -replace $endpoint.attribute, "replace content"} | set-content ./path/file.xml } } '''}
I have a Servers.xml file like below<Servers> <Environment id="1" name="Jenkins"> <Server id="1" ip="192.168.0.1" /> <Server id="2" ip="10.21.22.30" /> </Environment> <Environment id="2" name="Pipe"> <Server id="1" ip="192.10.2.77" /> <Server id="2" ip="122.30.45.99" /> </Environment> </Servers>I want to change value of ip according to Environment tagname. I google some answer, but most of them are usingXmlSlurperorXmlParser, unfortunately both of them are not permitted in my Jenkins pipeline and I gotScripts not permitted to use new groovy.util.XmlSlurper. Administrators can decide whether to approve or reject this signature.My question is that besidesXmlSlurperandXmlParser,is there some other method that can parse xml file in pipeline?I don't have the permission to permit the above two method. I don't have permission to download plugins either.Thank you!I trieddef fileContent = readFile xmlFile // def xml = new XmlParser().parseText(fileContent) // def xml = new XmlSlurper().parseText(fileContent) xml.Environment.each {...}and@NonCPS String extractFromXml(String xml) { def node = new XmlSlurper().parseText(xml) return node }all the above i gotScripts not permitted to use new groovy.util.XmlSlurper. Administrators can decide whether to approve or reject this signature.Now I don't want to use XmlParser or XmlSlurper, so I wander is there some other way to parse xml file in pipeline.
Besides XmlSlurper and XmlParser, is there some other Jenkins pipeline parse xml file method
From what I understand are APEX files Zipped Library which can contain Jar Files, I think it makes more sense to scan the pipeline which actually contains the code of the Apex Files.
I am first time usingOSASP Dependency checkusingAzure devops. Here this check is not scanning my apex class files and xml metadata files. So I wanna confirm is it scan those or not and what type of file it scan for salesforce projects?I tried to search fromowsapofficially site but from where it is not cleared.
Does OWASP dependency check worked on salesforce Apex class files(*.cls)
So the start and the end of namespaced visualisation will not be collapsed, it's not something that's configurable
I am looking for a way to group all of the raw datasets in a kedro pipeline visualization into one collapsible/expandable "node", similar to the way that namespaces are collapsible/expandable. In order to do this with a namespace, however, it seems that you need a function with inputs and outputs, which obviously would not be applicable at the raw data stage.Here is my current visualization:enter image description hereI would like datasets 0-5 to be grouped together into an expandable "node" called "raw data".I have searched stackoverflow, the kedro docs, and the community forum on github for ways to accomplish this, without finding much that is relevant. The closest concept I found is namespaces, but again it seems these need a function, input, and output.
Grouping raw datasets in a kedro visualization
no option comes to my mind workingThis is because, what you are asking for isnot possible.
Is it possible to update aws stack by another CF template file while retaining resources which were present in original CF file used to create the stack initially, but not in current CF file used to update it?I've looked into different api calls and stack files related stuff but no option comes to my mind working.
Adding resources to already existing stack by CF template on aws
Since the jar file is static one and not created as part of the build pipeline, you can save the jar file toAzure Artifacts Feed -> Universal Package.To upload the jar file to Azure Artifacts Universal Package, you can useUniversal Packages Task - Publish commandin Pipeline or Azure CLI command:az artifacts universal publish(work in pipeline or local machine).Then you can use the task:Universal Packages Task - Download commandto download the Universal Package during the build pipeline execution.
I have an Azure DevOps pipeline The pipeline has a "command line" task that runs a java command on a jar file The jar file is a static one that represents a tool to be used in the build process. The jar file is not created as part of the build pipeline. It's just a jar with one version and it doesn't change with each buildWhere is the best place to save this jar file and how to download it to the agent during the build pipeline execution ?
Where to save a reusable static jar to be used from an Azure DevOps pipeline?
Based on what rickhg12hs the code will be this:db.CSGO.aggregate([ { $group: { _id: '$country' , averageQuantity: { $avg: "$kd_ratio" }, }}])
i have a dataset with some columns like countries, players, kd_ratioi want to write a pipeline where i can group kd_ratio from all the countries and get the average.Im trying this:db.CSGO.aggregate([ { $group: { _id: { country: { $country: "$all" }, nick: { $nick: "$all" } }, averageQuantity: { $avg: "$kd_ratio" }, }}])
MongoDB pipeline group and take all data from one column and make the average
You can get the status as 'success' or 'failed' in the json report only if the job fails. Job doesn't fail in case of it finds any Vulnerbilities.Here is the information from gitlab documentation:Jobs pass if they are able to complete a scan. A pass result does not indicate if they did, or did not, identify findings. The only exception is coverage fuzzing, which fails if it identifies findings.Jobs fail if they are unable to complete a scan. You can view the pipeline logs for more information.All jobs are permitted to fail by default. This means that if they fail, it does not fail the pipeline.If you want to prevent vulnerabilities from being merged, you should do this by adding Security Approvals in Merge Requests which prevents unknown, high or critical findings from being merged without an approval from a specific group of people that you choose.We do not recommend changing the job allow_failure setting as that fails the entire pipeline.
I am trying to implement a gitlab pipeline used to detect secrets on commits before they are pushed, and prevent the commits from going live. The detection part works just fine. However the pipeline always marks the job as successful, even though the fake secrets i've added are detected, and let the commits got public.I have tried to scan the detection report : if it's not empty, a message warning the user is displayed, and an exit code is returned. For some reason though, said exit code gets ignored.Here is the yml config i'm using :include: - template: Jobs/Secret-Detection.gitlab-ci.yml secret_detection: variables: SECRET_DETECTION_HISTORIC_SCAN: "true" SECRET_DETECTION_IMAGE_SUFFIX: "-fips" after_script: - | reportFile="gl-secret-detection-report.json" $a: wc -l gl-secret-detection-report.json $b: 0 if [ $a -gt $b ]; then echo "VULN FOUND. SEE $reportFile FOR MORE DETAILS." && exit 1 fiI'm quite at a loss here, any help is appreciated. Thanks !
Pipeline failure on secret detection - Gitlab
The following code shows a transform stream that buffers incoming objects (or arrays of objects) until it has 100 of them and then pushes them onwards as an array:var t = new stream.Transform({ objectMode: true, transform(chunk, encoding, callback) { this.buffer = (this.buffer || []).concat(chunk); if (this.buffer.length >= 100) { this.push(this.buffer); this.buffer = []; } callback(); }, flush(callback) { if (this.buffer.length > 0) this.push(this.buffer); callback(); } }).on("data", console.log); for (var i = 0; i < 250; i++) t.write(i); t.end();You can include such a transform stream in yourpipeline.And here's the same in Typescript. It can very probably be done more elegantly, but I am no Typescript expert.class MyTransform extends Transform { buffer: Array<any>; } var t = new MyTransform({ objectMode: true, transform(chunk, encoding, callback) { var that = this as MyTransform; that.buffer = (that.buffer || []).concat(chunk); if (that.buffer.length >= 100) { this.push(that.buffer); that.buffer = []; } callback(); }, flush(callback) { var that = this as MyTransform; if (that.buffer.length > 0) this.push(that.buffer); callback(); } }).on("data", console.log); for (var i = 0; i < 250; i++) t.write(i); t.end();
I have a function in which I read CSV file as a readable stream using the "pipeline" method, splitting it by rows and transforming the data of each row, then I add the data to an array. When the pipeline is finished, I insert all the data to a database.This is the relevant part of the code:pipeline(storageStream as Readable, split(), this.FilterPipe(), this.MapData(result)); public MapData(result: Array<string>): MapStream { return mapSync((filteredData: string) => { const trimmed: string = filteredData.trim(); if (trimmed.length !== 0) { result.push(trimmed); } }); }We have encountered sometimes with memory limits since we uploaded a big amount of very large CSV files, so we have decided to try to split the logic into insertion batches so we won't use a lot of memory at the same time.So I thought to handle the readed data by batches, in which per every batch (let's say 100 rows in the file), I will trigger the "MapData" function and insert the result array to the DB.Is there any option to add a condition so the MapData will be triggered every X rows? Or, if there is any other solution that might meet the requirement?Thanks in advance!
How to write batches of data in NodeJS stream pipeline?
I have mainly automated with Gitlab but will share my ideas probably may help with your specific case.So we use version control to manage our apigee repos. I have setup a gitlab pipeline that checks for the diff anytime we push to our repository and only if there are any changes do we redeploy the proxy to Apigee. Normally when the pipeline is triggered, we check if there are any changes to target servers, proxies and shared flows, and if changes are detected, we check the deployed revision and environments.Through my deployment script, i am able to get a list of these changes and pass them to the pipeline asCHANGESvariable. This means that only these modified proxies will be deployed.On my pipeline I could do something like thisgit diff --name-only $CI_COMMIT_SHA..$CI_COMMIT_BEFORE_SHA > /changes.txtand pass the content of the changes file to theCHANGESto be deployed.
Is there any recommended method to create and deploy theApigee API Proxy Bundlevia a CI/CD pipeline (I'm using Azure DevOps)?I want to avoid excessive API Proxy Bundles from being created and deployed when there are no changes to be made. I've already tested, and I see that identical bundles still create a new revision.So far, my own solution is to write a PowerShell script to useapigeeclito download the current bundle and compare it against theapiproxythat I have locally in my repo. If it differs, I create and deploy a new API Proxy Bundle.Has anyone seen anything better?
Automate Apigee API Proxy Deployment in CI/CD Pipeline
I did this myself. I'd like to help anyone who has same task with me. Let me add the result.db.gigs.aggregate([ { $lookup: { from: "users", localField: "_id", foreignField: "likedGigs", as: "liked_users" } }, { $project: { numberOfLikes: { $size: "$liked_users" } } }, { $skip: 3 }, { $limit: 2 }, { $match: { numberOfLikes: { $gt: 0 } } } ])
I am new to MongoDB. I started to study MongoDB 2 months ago. So I can do CRUD operation. But now I am having trouble in using aggregation.Let me explain my problem.I have two collections (users, foods). users { _id: "...", favouriteFoods: ["...", "...", "...",...] } foods { _id: "...", name: "..." }.I want to get the list of foods which has favourited user. So output is like this. Favourited_Foods [ _id: "...", name: "...", numberOfFavourites: 4, ]Anyone who is expert in MongoDB Aggregation, please help me. Thank you.I tried to use $lookup pipeline to perform this action. But As I said I am new to MongoDB. So I couldn't do this for 3 days.
MongoDB Aggregation Challenge
You absolutely have to do this yourself. The best way I know of is to create an external management system that controls when pipelines are submitted. One feature of that would be concurrency, so you can configure your pipeline to only permit one run at a time. I have done a lot of work on this concept over the past few year, first in ADF and now in Synapse.Here isanother SO Answerwhere I discuss some of this, and here is avideo recordingof a presentation I gave a few years ago discussing this topic. Some of the details have evolved, and your implementation may be very different, but the concepts are the same.
I have created an Azure Synapse Analytics pipeline that is triggered every time a new file is added to a certain directory.It basically obtains the name of the file as input parameter of a notebook, which then reads said file and updates a lake database. If a file is added while the pipeline is running, a second instance of the same pipeline is created simultaneously. My question is, how do I make sure that the two instances of the same pipeline are not modifying the database at the same time? Is this feature implemented by default or do I have to ensure it with my code?
How can I ensure that only one instance of an Azure Synapse Pipeline modifies a lake database at the same time?
The quick'n'dirty way was answered here:Dump all variables for bashSo by addingprintenvto a pipeline step and commit it.In this specific case (being a Bitbucket-pipeline), I could find the answer here:Variables and secretsFind it under: Settings >> Repository variables.
I'm taking over some code, where I can see a line like this in thebitbucket-pipeline.yaml-file:if [ $THEME_NAME ]; then cd ./site/web/app/themes/$THEME_NAME/ && yarn && cd ../../../../../trellis; else cd ./trellis; fiBut I've searched the code base for$THEME_NAMEandTHEME_NAMEand this is the only place it's referenced.As you can probably see, then it's built usingTrellis, which is built on top of WordPress. So maybe it's a global variable.How do I figure out, where this (and other) variable resolves to?Solution-thoughts:The quick'n'dirty way would be to simply add a step in the pipeline that echo's all the global variables, but it seems yucky, since I would have to remove that commit again, and have to make the bash-script that did this, etc.
Find pipeline-variables for a Bitbucket pipeline
Firstly you should know the syntax for using these environment variables depends on the scripting language, for example:PowerShell script: $env:VARIABLE_NAME Bash script: $VARIABLE_NAMEAnd you can refer the document :Define Variables2 from your screenshot, you use $env:SYSTEM_ACCESSTOKEN in your bash script and the running log shows thatBoth a username and password must be explicitly provided when using/logintype:serviceidentity.As you can see, it indicates the server cannot recognize the variable you provided because your syntax for using is wrong.3 you can use PowerShell script instead of bash scriptThe task PowerShell Scriptthen you can run the Power Shell script successfully
Getting error while running this pipelines, this is pipeline for Export solution then unpack the solution and push to TFVC repo in azure devops. please check the following screenshot for your referencePipeline task detailsPipeline picture
Getting error in bash script in azure devops pipeline for power app solutions
I read:corn: "30 20 * * 1,2,3,4,5,6".cornis yummy but it's not great for scheduling tasks; trycron:DIf it still doesn't work, try with a slightly modified syntax for yourfilterssection:scheduled-workflow: triggers: - schedule: cron: "30 20 * * 1,2,3,4,5,6" filters: branches: only: - masterLet me know if this helps.ShareFollowansweredOct 19, 2022 at 16:46yaningoyaningo45833 silver badges99 bronze badges2That being said, as thecorn(instead ofcron) typo passes the config validation, you couldn't get any hint on what was causing the issue. It'd be something to bring up to CircleCI's attention. Although, since thescheduled workflows functionality will be phased out by the end of 2022, I'd highly recommend migrating toscheduled pipeline.–yaningoOct 23, 2022 at 21:59Ah Thanks, Will surely look into scheduled pipelines. Thanks for the help though.–Muhammad HarisNov 25, 2022 at 12:03Add a comment|
The below code works fine whenever there is a new commit. It automatically runs which is fine. However, I want to schedule a workflow that should run daily on a specific time. But the below code is not working for that. Any idea what could be wrong here?version: 2.1 orbs: cypress: cypress-io/cypress@1 workflows: build: jobs: - cypress/run: store_artifacts: true scheduled-workflow: triggers: - schedule: corn: "30 20 * * 1,2,3,4,5,6" filters: branches: only: master jobs: - cypress/run
CircleCI - Scheduled workflow does not run Cypress
This works and there are probably other ways to do it:foreach ($i in $input) { $i }17:12:42 PS>1..20 | .\cmd-input.ps1123-- snip --181920Search for "powershell $input variable" and you will find more information and examples.A couple are here:PowerShell Functions and Filters PowerShell Pro!(see the section on "Using the PowerShell Special Variable “$input”")"Scripts, functions, and script blocks all have access to the $input variable, which provides an enumerator over the elements in the incoming pipeline. "or$input gotchas « Dmitry’s PowerBlog PowerShell and beyond"... basically $input in an enumerator which provides access to the pipeline you have."For the PS command line, not theDOS command lineWindows Command Processor.ShareFolloweditedApr 25, 2014 at 20:01answeredMay 20, 2009 at 0:16BratchBratch4,15355 gold badges2828 silver badges3232 bronze badges2Time for a little necro-ing...just for the benefit of anyone that wanders along and reads this, DOS is still available on every version of windows. 64 bit or 32 bit.–EBGreenJun 24, 2011 at 13:1414EBGreen,ntvdm, which is the DOS VM Windows NT has, does not exist on 64-bit systems anymore.cmd.exeisnotDOS; it's the Windows Command Processor and has, apart from grey text on black, nothing in common with DOS at all.–JoeyJun 12, 2012 at 20:01Add a comment|
I am trying to write a PowerShell script that can get pipeline input (and is expected to do so), but trying something likeForEach-Object { # do something }doesn't actually work when using the script from the commandline as follows:1..20 | .\test.ps1Is there a way?Note: I know about functions and filters. This is not what I am looking for.
Using Pipeline to pass an object to another Powershell script [duplicate]
I have found the solution to my problem, the good syntax was :param_grid = {'columntransformer__pipeline-2__functiontransformer__kw_args': [{'num_corr_threshold': 0.0}]}I found the solution on this topic :How can I make the FunctionTransformer along with GridSearchCV into a pipeline?Thank you !ShareFollowansweredOct 1, 2022 at 18:39Louis DemangeLouis Demange2511 silver badge55 bronze badgesAdd a comment|
I have a function here I would like to fine tune with the 'num_corr_threshold' parameter :def categorical_anticorr(X_cat_in,num_corr_threshold=0.5): if type(X_cat_in) == np.ndarray: X_cat_in = pd.DataFrame(X_cat_in) elif type(X_cat_in) == type(csr_matrix(0)): X_cat_in = pd.DataFrame(X_cat_in.toarray()) corr_num = X_cat_in.corr(method='spearman') upper = corr_num.where(np.triu(np.ones(corr_num.shape), k=1).astype(bool)).abs() col_to_drop = [column for column in upper.columns if any(upper[column] > num_corr_threshold)] return X_cat_in.drop(columns=col_to_drop)I inserted this function in a complex pipeline named 'preproc'.In order to find the name of the parameter to fine tune, I used the command : 'preproc.get_params()'.I fand the parameter in the list, it was :'columntransformer__pipeline-2__functiontransformer__func': <functionmain.categorical_anticorr(X_cat_in, num_corr_threshold=0.5)>After I tried to insert this hyperparam in my grid with the command :param_grid = {'columntransformer__pipeline2__functiontransformer__func': <functionmain.categorical_anticorr(X_cat_in, num_corr_threshold=0.5)>}Unfortunately, I got the error message : SyntaxError: invalid syntax.Please, does anybody know the correct syntax to fine tune for example the 'num_corr_threshold' parameter of the categorical_anticorr function ?Thanks in advance.Best regards.
Fine-tune hyperparameters of a FunctionTransformer in a pipeline
I'm also a beginner but I'm trying to answer. First you can add"cypress:open" : "cypress open"to the file package.json. For more details you can watch thisvideoShareFollowansweredOct 6, 2022 at 2:24AVNCNTAVNCNT8833 bronze badgesAdd a comment|
I see many instances of this question but nothing that helps me. Apologies if this question gets boring.I am just starting out with node.js, Cypress and GitLab Pipelines.I've cobbled together something that has a simple web app, a few simple tests. It ran fine the first time but, on subsequent commits, it fails at the 'Cypress Tests' step with:The cypress npm package is installed, but the Cypress binary is missing.There's a lot more to the log but I don't know what is relevant.Here is my yml filecypress tests: stage: test image: cypress/browsers:node14.17.0-chrome91-ff89 cache: key: package-lock.json paths: - node_modules before_script: - npm install - npm run dev & - ./node_modules/.bin/wait-on http://localhost:3000 script: - npm run cypress only: - merge_requests - masterCould you please help with anything that looks like it might be the culprit? Or at least help me understand how to read the situation better? I tried reading the docs as much as I can, I just can't see the right way.
The cypress npm package is installed, but the Cypress binary is missing (newbie)
The error message is informing you what the issue is: you need to authenticate with Docker Hub before you can access authenticated functionality.The Docker docshighlight multiple ways of doing this.Some options:Authenticate using thedocker logincommand directly:https://docs.docker.com/engine/reference/commandline/login/#optionsUse a proper credentials store:https://docs.docker.com/engine/reference/commandline/login/#credentials-storeShareFollowansweredMar 15, 2023 at 22:00rdeggesrdegges33.2k2121 gold badges8686 silver badges109109 bronze badgesAdd a comment|
I am trying to use docker scan command in gitlab CI. I am loggin in to docker hub using docker login command and after that I am running docker scan --accept-license :. On my local machine everything works fine, but pipeline failing with this error:failed to get DockerScanID: You need to be logged in to Docker Hub to use scan feature. please login to Docker Hub using the Docker Login commandAnyone could help to understand what I am doing wrong?
Docker scan step is failing on pipeline with login error
I ended up just creating aNodeobject separately. So I used the following line:def node = new groovy.util.Node(null, 'span', child)Then I just appended that node to another node using theappendfunction.ShareFollowansweredSep 21, 2022 at 18:27frankM_DNfrankM_DN36111 silver badge77 bronze badgesAdd a comment|
I am trying to modify an html file in a Jenkins pipeline and I need to add aspantag. In groovy I can do the followingdef newNode = new StreamingMarkupBuilder().bind { span {mkp.yield("$child")}}wherechildis a string to put in thespantag.When I tried to do this in a Jenkins Pipeline, I got an error related to a CPS mismatch so I added@NonCPSbut I am now getting an error that saysjava.lang.NoSuchMethodError: No such DSL method 'span' found among stepsI found this:https://www.jenkins.io/doc/book/pipeline/cps-method-mismatches/that talks about CPS mismatches. I think it is basically trying to use thespantag as a DSL method, similar tostageorsteps. So is it possible to somehow use theStreamingMarkupBuilder.bind()function like I am trying to without Jenkins interpreting thespantag as a DSL method?
How To Use groovy.xml.StreamingMarkupBuilder in Jenkins Pipeline
How can I use the $tag under displayName in the next stage of the pipeline?No, runtime variables are absolutely impossible to get in compile time. The values of display name are captured before any of the stage actually run, unless you pass a compile-time expression, otherwise anything will be handled as 'string'.Take a look of this:https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#understand-variable-syntaxOnly this situation can work:trigger: - none pool: vmImage: ubuntu-latest stages: - stage: A jobs: - job: A1 steps: - bash: | tag="testtag" echo "##vso[task.setvariable variable=myStageVal;isOutput=true]$tag" name: MyOutputVar - stage: B dependsOn: A jobs: - job: B1 variables: myStageAVar: $[stageDependencies.A.A1.outputs['MyOutputVar.myStageVal']] steps: - bash: echo $(myStageAVar)ShareFolloweditedSep 21, 2022 at 8:56answeredSep 21, 2022 at 2:58Bowman Zhu-MSFTBowman Zhu-MSFT5,89211 gold badge99 silver badges1212 bronze badges1Yes, I can get them within the step of my next stage as you have done above. But agree with you there is no way I can get that displayed under stage name.–AmirSep 21, 2022 at 21:39Add a comment|
I have build a yaml pipeline which has multiple stages in them. To ensure all the stages are using the same git tag, I am trying to display the git tag in the displayName of each stage.I have a job within the stage which goes and finds the git tagstages: - stage : stageA jobs: - job: Tag steps: - bash: | tag=`git describe --tags --abbrev=0` && echo "##vso[task.setvariable variable=version_tag;isOutput=true]$tag" echo "$tag" name: setTagHow can I use the $tag under displayName in the next stage of the pipeline?
displayName with variable in azure devops pipeline
I got it working. Seestdout buffering. I needed to feed stdout a newline instead of flushing, all good! :)ShareFollowansweredSep 17, 2022 at 6:08Don_twiceDon_twice5111 silver badge77 bronze badgesAdd a comment|
This is part of a university assignment but the problem I have does not relate to the assignment itself.I have a C file that is waiting for two inputs from terminal, there are twogets(info1)and later agets(info2). I have a buffered writed that I use to do the following inside python:sys.stdout.buffer.write("Hello 1".encode("ascii")) sys.stdout.flush() sys.stdout.buffer.write("Hello 2".encode("ascii")) sys.stdout.flush()I then have a pipeline that sends these outputs from the python code to the input of the C program using the terminal. When I run the command I can see on the prints that both "Hello 1" and "Hello 2" is sent togets(info1). Why is this happening? Since I flush the buffer should it not send the first input to the terminal, getting catched by the C firstgets(info1)and "Hello 2" getting catched in the secondgets(info2)? I even introduced a sleep function after the first flush but it sleeps then sends both the outputs to the firstgets(info1). The pipeline obviously works since the C program is able to get the output from terminal produced by the python program. But why am I only gettings inputs to the first function even though I flush the buffer after the first string is written?When I dosys.stdout.buffer.write("Hello 1".encode("ascii")) sys.stdout.buffer.write("\n".encode("ascii")) sys.stdout.flush() sys.stdout.buffer.write("Hello 2".encode("ascii")) sys.stdout.flush()It sends it properly. However, I need the output to be very specific
Python and C pipeline: Python does not write from buffer when I flush
You will need to connect theautoaudiosinkthe thedecodebin3. Currently you areconnectingthe sink to the video sink - which obviously is bogus.It it also advised to use aqueueafter each demuxer pad. Try:"rtspsrc protocols=tcp location=" + urlStream_ + " latency=300 ! decodebin3 name=decodebin ! queue ! autovideosink decodebin. ! queue ! autoaudiosink";ShareFollowansweredSep 17, 2022 at 8:32Florian ZwochFlorian Zwoch7,00822 gold badges1212 silver badges2222 bronze badges1the video is still frozen and no audio–l12Sep 20, 2022 at 12:52Add a comment|
My PIPELINE-DESCRIPTION only video works:"rtspsrc protocols=tcp location=" + urlStream_ + " latency=300 ! decodebin3 ! autovideosink ! autoaudiosink";But... I would like receive video+audio. I only receive it on the first frame and no audio:"rtspsrc protocols=tcp location=" + urlStream_ + " latency=300 ! decodebin3 ! autovideosink ! autoaudiosink";
Receive video+audio with pipeline
If by "local drive" you mean a user's personal PC then no, that's not what you would do in Production. You would land the data on a server or in a cloud storage location.ShareFollowansweredSep 16, 2022 at 10:52NickWNickW9,12822 gold badges77 silver badges2020 bronze badgesAdd a comment|
I read the book ‘Data Pipelines Pocket Reference’ from James Densmore. Like many other pipelines, this sample pipeline saves the data in the extract phase to csv on the local drive. Is this also how it would go in production? Saving the file first on the local machine and then upload it to a data lake or whatsoever?
Data Engineering - Extract Phase
I fixed it by adding.encode("utf-8")tosoup.That means thatprint(soup)becomesprint(soup.encode("utf-8")).ShareFolloweditedDec 4, 2019 at 19:36twasbrillig17.9k99 gold badges4343 silver badges6767 bronze badgesansweredNov 23, 2014 at 19:19SstrykerRSstrykerR8,34244 gold badges1313 silver badges1111 bronze badges47don't hardcode the character encoding of your environment (e.g., console) inside your script,print Unicode directly instead–jfsSep 7, 2015 at 4:097This is just printing the repr of abytesobject, which will print as a mess of\xsequences if there's a lot of UTF-8 encoded text. I recommend usingwin_unicode_console, as @J.F.Sebastian suggests.–Eryk SunMay 23, 2016 at 20:4810This makes it print outb'\x02x\xc2\xa9'(a bytes object) instead–MilkyWay90Jun 16, 2019 at 16:201Solution doesn't work. - 2024–Robert CarmichaelFeb 23 at 10:52Add a comment|
I'm trying to scrape a website, but it gives me an error.I'm using the following code:import urllib.request from bs4 import BeautifulSoup get = urllib.request.urlopen("https://www.website.com/") html = get.read() soup = BeautifulSoup(html)And I'm getting the following error:File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 70924-70950: character maps to <undefined>What can I do to fix this?
I keep getting 'charmap' codec can't encode characters error when trying to save python script's output to clipboard or text file [duplicate]
As this is running on an Ubuntu Linux machines, the names of the folders and files are case sensitive. I doublechecked that. And I added "E2E-Pipelines" to the Scriptpath.ScriptPath:'E2E-Pipelines/1.0/scripts/sync-wiki-repo.ps1'Now my powershell file can be found. It is solved.ShareFollowansweredSep 12, 2022 at 13:50Filip BAFilip BA7188 bronze badgesAdd a comment|
In myyaml fileI have two tasks :CopyFilesandrun a Powershell script.If only the Powershell task is there, then no problem. I runs fine. So the ScriptPath is OK. But with the CopyFiles task preceding, it isn't able to find the Powershell file anymore (see screenshot). Anyone has an idea?jobs: - job: sync_wiki_repo displayName: 'Sync wiki' steps: - checkout: wiki - task: CopyFiles@2 displayName: Copy wiki files inputs: contents: 'Wiki/Distribution/Client-Welcome-Page/Readme.md' **targetFolder**: '$(System.DefaultWorkingDirectory)/wiki-staging' overWrite: true - checkout: git://something/set-wiki #checkout specific branch - task: AzurePowerShell@5 displayName: 'Set wiki' inputs: azureSubscription: 'mysub' ScriptType: 'FilePath' **ScriptPath**: '1.0/scripts/sync-wiki-repo.ps1' ScriptArguments: '-wikipat $(e2e-pipelines-manage-wiki-secret) -project ${{parameters.project}}' azurePowerShellVersion: 6.4.0 workingDirectory: '$(System.DefaultWorkingDirectory)'
Azure pipeline can't find script when preceded by other task
The solution was just add thefast_finish: trueoption underjobs:jobs: include: - fast_finish: trueShareFollowansweredSep 6, 2022 at 10:32X TX T45588 silver badges2424 bronze badgesAdd a comment|
I’m traying to finish the execution of the remaining scripts in a Travis pipeline as soon as one of them fails in any stage. So that if any of those scripts fails in the stage, no more scripts are executed and the remaining jobs in the stage are ignored…I includedfast_finishunder jobs but I’m not sure if this option will finish the stage execution if any of the scripts fails.jobs: include: - fast_finish: trueI have some bash scripts in some the pipeline stages like this one:- stage: test before_script: # do_something script: - ./first_script - ./second_script - ./third_scriptTo test if that’s working I simulated an error withtravis_terminate 1in the middle of the scripts above. It basically finish its execution but I’m pritty sure that I’m not simulating an error propertly.Any idea if I’m using correctlyfast_finishand how to simulate an error with any travis command?
Fast_finish option to finish execution of scripts in Travis
Every Pipeline step is secuential, so if you are puttting aKNNand aDTCjust afterwards, you are trying to make aDTCwith the output of theKNN.I think that you are trying to make a customEnsemblemodel. CheckVotingClassiffierto make a customEnsemble, but I think that the Pipeline object can only see oneRegressorMixInin its steps, so this should do the trick:steps = [('scaler', StandardScaler()), ('regressor', VotingClassifier(estimators=[ ('knn', KNeighborsClassifier()), ('dt',DecisionTreeClassifier())]))] pipeline = Pipeline(steps)ShareFollowansweredAug 25, 2022 at 7:57AngeloAngelo62533 silver badges2020 bronze badgesAdd a comment|
I am trying to use pipeline, for implementing two classifiers together. For this I wrote the following code:steps = [('scaler', StandardScaler()),('knn', KNeighborsClassifier()),('dt',DecisionTreeClassifier())] pipeline = Pipeline(steps) parameters = [{'knn__n_neighbors': np.arange(1, 50)}] X_train, X_test, y_train, y_test = train_test_split(X, y.values.ravel(), test_size=0.3, random_state=65) cv = GridSearchCV(pipeline, param_grid=parameters) cv.fit(X_train, y_train) y_pred = cv.predict(X_test)Pipeline worked fine, while I was using Knn method, however when I used Decision tree classifier, following error occurred:TypeError: All intermediate steps should be transformers and implement fit and transform or be the string 'passthrough' 'KNeighborsClassifier()' (type <class'sklearn.neighbors._classification.KNeighborsClassifier'>) doesn't.How can I add multiple models in a pipeline with different parameters for different models.
Using pipeline for two models
So after few tries, this is works.container('deployer') { wrap([$class: 'BuildUser']) { sh """ curl -X POST --data-urlencode \"payload={'channel': '#notification-test-devops', 'username': 'Jenkins Build', 'text': \\\"[Blocked Production] ${env.JOB_NAME} #${BUILD_NUMBER}\nCommit ID: ${GIT_COMMIT}\nCommit Message: ${GIT_COMMIT_MSG}\n<${BUILD_URL}|View Build>\\\", 'icon_emoji': ':jenkins:'}\" https://hooks.slack.com/services/XXX/XXX/XXX """ } }You can ignore the wrapping, because I only use it withbuild-user-vars-pluginShareFollowansweredAug 22, 2022 at 0:51M TriM Tri111 bronze badgeAdd a comment|
I want to use jenkins env variable with SH, but inside multiple quote fromcurl.Example:script { container('deployer') { sh "curl -X POST --data-urlencode \"payload={'channel': '#notification-test-devops', 'username': 'Jenkins Build', 'text': '[Blocked Production] ${env.JOB_BASE_NAME} (${env.BRANCH_NAME} #${BUILD_NUMBER}) <${BUILD_URL}|View Build>', 'icon_emoji': ':jenkins:'}\" https://hooks.slack.com/services/XXX/XXX/XXX" } }Current result seems it's not rendered:[Blocked Staging] ${env.JOB_BASE_NAME} (${env.BRANCH_NAME} #${BUILD_NUMBER}) <${BUILD_URL}|View Build>ScreenshotExpectation: The jenkins env variable will be rendered in Slack message.
Use jenkins environment variable in SH script with multiple quote
The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.The error shows that the user accessing the resources with anonymous access.I hope you are logged in withaz devops loginonly once when running the pipeline. If not avoid multiple logins.echo $Pat_key| az devops loginSteps to fix the issue:while running the pipeline you are getting the User is not authorized to access this resource error make sure it has a valid resource access. If the user has access to the resources, please make sure to clear the cache before running the script. (The organization is connected to AAD, and the user has part of the AAD)Reset thePATtoken resolve the issue.ShareFollowansweredAug 17, 2022 at 12:37Delliganesh SevanesanDelliganesh Sevanesan4,50211 gold badge66 silver badges1616 bronze badgesAdd a comment|
I've written a simple AzureCLI script which should update a variable group value for a project. I've tested the script locally and this workds find so I know its an ADO issue, this script is:echo $Pat_key| az devops login az devops configure -d organization=https://dev.azure.com/****/ project=*** az pipelines variable-group variable update --id 365 --name release.version --value **-Release-1.2.0I've tried a few differnt flavours, either running in powershell or adding the PAT token manually or not at all and either get AzureCLI just hanging and not progressing the task. If I get an error message, this is what I get:ERROR: TF400813: The user 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' is not authorized to access this resource.Any help would be amazing. Thanks again!
Azure CLI pipeline task hanging on ADO
The storage account can be recovered in a few cases within 14 days. While creating the storage account we will mention the retention time, using which we will be using the deleted storage accounts.Checkout the screenshot for the retention timing allocation.When the pipeline is created, the storage account gets connected to it. It will be an independent entity. Once the data of the pipeline can be lost, but the storage account cannot be lost by default. If the storage account also included in deletion process while deleting pipeline, we can recover in often cases using the time mentioned in this data protection phase.To clone the model with the GIT use the following procedureGet the keys required to cline. Install GIT BASHssh-keygen -t rsa -b 1234 -C[email protected]Clone the Git Repository usinggit clone[email protected]:GitUser/repo.gitCloning into 'azureml-example'...ShareFollowansweredSep 3, 2022 at 8:13Sairam TadepalliSairam Tadepalli1,60711 gold badge44 silver badges1111 bronze badgesAdd a comment|
I have 2 queries.I am creating a Pipelines with Azure ML Designer. Most of them are in Pipeline Draft state. Accidentally the workspace was deleted by one of the Azure tech team.Will the pipeline draft will also be saved in the Azure Storage account or only the pipelines which are run/submitted only be saved in the Storage container. If the drafts also saved in the storage, could you share the folder where it is stored so that I could use it for restoration.Query 2How to save the Azure ML Pipelines created using the Azure ML designer to be saved in the GIT or some other backup device for future restoration purpose incase of any mishap.Is it possible to backup pipeline drafts in GIT?Thank you.
Saving Azure ML pipelines in GIT or backup somewhere
function Choose () { [CmdletBinding()] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [string[]] $Text ) begin { $file = New-TemporaryFile $Text } process { foreach ($line in $Text){ $line >> $file } } end{ start-process nvim $file -wait Get-Content $file Remove-Item $file } }and using it to edit the git sparse-checkout listfunction Git-Sparse-Checkout-Edit { git sparse-checkout list | Choose | git sparse-checkout set --stdin }Usingstart-processseems to be the key to stop the pipeline stalling though I'm not sure why.ShareFollowansweredAug 8, 2022 at 7:36bradgonesurfingbradgonesurfing31.5k1919 gold badges117117 silver badges224224 bronze badgesAdd a comment|
I wish to edit the gitsparse-checkoutinformationinplaceusing thenvimeditor. I have the following code that almost works.function Choose () { begin { $file = New-TemporaryFile } process { $_ >> $file } end { nvim $file Get-Content $file Remove-Item $file } } function Git-Sparse-Checkout-Edit { git sparse-checkout list | Choose | git sparse-checkout set --stdin }if I writegit sparse-checkout list | Choosethen the nvim editor is opened on the output of the git sparse-checkout command and when I 'wq' ( save and quit ) then the contents of the file are written to stdout. But when I trygit sparse-checkout list | Choose | git sparse-checkout set --stdininstead of opening the editor the entire windows terminal stalls and I have to kill it. Is my Choose function correctly implemented?
How to write a Choose function in powershell to edit the pipeline?
Test the same settings in the AzureAppServiceSettings task, I can reproduce the same situation. It seems that the AzureAppServiceSettings task is not able to update the ARR affinity value.For a workaround, you can change to use Azure CLI Task to run the Azure CLI:az webapp updateto update the ARR affinity value.For example:steps: - task: AzureCLI@2 displayName: 'Azure CLI ' inputs: azureSubscription: xx scriptType: ps scriptLocation: inlineScript inlineScript: 'az webapp update --name xx --resource-group xx --client-affinity-enabled false'ShareFollowansweredAug 4, 2022 at 3:01Kevin Lu-MSFTKevin Lu-MSFT26.5k33 gold badges2121 silver badges3434 bronze badgesAdd a comment|
I'm trying to modify the "ARR affinity" (clientAffinityEnabled) property in App Service General Settings with a pipeline task but it doesn't work, the value doesn't change. This pipeline works OK with other General Settings properties.Another approach to solve this?Azure DevOps pipeline task:- task: AzureAppServiceSettings@1 inputs: azureSubscription: XXXXXXX ResourceGroupName: XXXXXXX appName: XXXXXXX generalSettings: | [ { "clientAffinityEnabled": false } ]
Change ARR affinity property from General Settings with Azure Devops pipeline
I found the right way: define command as script command and use it in script section, not variables:.grep-command: &grep-command - dotnet ef migrations list | grep "VERY_LONG_PATTERN_HERE" job1: script: # some job specific code - *grep-command(By the way saving command as variable also works, just use it carefully, but I suppose it is not so clear - variables must stay variables, and commands - as commands. I find it bad practice to mix them)ShareFollowansweredJul 29, 2022 at 9:40Mikhail_SamMikhail_Sam10.9k1111 gold badges7070 silver badges106106 bronze badgesAdd a comment|
I need to run big command in several jobs and save results in dynamically created variables. My idea - save such command as variable and evaluate it in script sections of all jobs. For example:.grep_command: &grep_command GREP_COMMAND: dotnet ef migrations list | grep "VERY_LONG_PATTERN_HERE" job1: variables: <<: *grep_command script: # some job specific code - echo $GREP_COMMAND - VAR=$(${GREP_COMMAND}) # doesn't work job2: variables: <<: *grep_command script: # some job specific code - echo $GREP_COMMAND - echo "VAR=$(${GREP_COMMAND})" > build.env # also doesn't work
Gitlab CI: save command in variable
You can add condition, for example:az group exists --name $(rgName)Or alternatively, you can add a task to your stage that does what you are looking for with two tasks in the stage. The condition you can set to verify if the information exists and download that through the azure CLI command in the yaml pipeline. Furthermore, you can specify these tasks pre and post deployment.Moreover, something like this would force all items to delete and ensures that all resources are deleted:az vm delete \ --resource-group myResourceGroup \ --name myVM \ --force-deletionFor more details:https://learn.microsoft.com/en-us/azure/virtual-machines/delete?tabs=portal2%2Ccli3%2Ccli4%2Cportal5ShareFolloweditedDec 16, 2022 at 21:0032cupo88055 gold badges1919 silver badges3838 bronze badgesansweredDec 9, 2022 at 22:53MeachMeach133 bronze badgesAdd a comment|
We have a YAML CICD pipeline. CI part creates a build on a generic Azure agent. CD part is run on a specific VM with additional tools/utilities. CD part will do some integration test.We encountered issue that the VM has data left from previous run pipeline, adding clean up code to the CD part of the pipeline does not completely solve the issue because the pipeline could be cancelled manually.We need something like pre-deployment task before downloading bits from pipeline artifacts, or post deployment task that will be invoked even the pipeline is cancelled manually. Any document/examples for adding pre-deployment and post-deployment task to a YAML based CICD pipeline ?
How to add a pre-deployment task to deploy stage of a YAML based CICD pipeline
I have managed to fix this with some help.- stage: Deploy${{parameters.environmentType}}Environment displayName: Deploy ${{parameters.environmentType}} Environment ${{ if ne(parameters.environmentType, 'prd') }}: dependsOn: - Validate_${{parameters.environmentType}} - GetADUserUPN ${{ if eq(parameters.environmentType, 'prd') }}: dependsOn: - Preview_${{parameters.environmentType}} - GetADUserUPN jobs: - job: DeployResouucesTo${{parameters.environmentType}}ShareFollowansweredJul 18, 2022 at 15:36Max RickettsMax Ricketts333 bronze badgesAdd a comment|
I have a multi-stage deploy file that does validation of Bicep, then a pre-flight what-if and then the final deploy. They all depend on a little bit of code that takes a UPN and returns the ID. This is for the bicep file to tag the resource and add role assignments.I am getting an error stating that the dependsOn is already defined.I thought this would be ok as I got an answer from another Stack article (Azure pipeline - Stage condition dependson), but this does not seem to work for me.I am very new to yaml pipelines so please forgive any apparent mistakes.# Deploy resources to the environment - stage: Deploy${{parameters.environmentType}}Environment displayName: Deploy ${{parameters.environmentType}} Environment ${{ if or( eq(parameters.environmentType, 'dev'), eq(parameters.environmentType, 'uat'), eq(parameters.environmentType, 'prd')) }}: dependsOn: GetADUserUPN ${{ if ne(parameters.environmentType, 'prd') }}: dependsOn: Validate_${{parameters.environmentType}} ${{ if eq(parameters.environmentType, 'prd') }}: dependsOn: Preview_${{parameters.environmentType}} jobs: - job: DeployResouucesTo${{parameters.environmentType}} displayName: Deploy Resources to ${{parameters.environmentType}} variables: myuserID: $[stageDependencies.GetADUserUPN.PSGetAZADUser.outputs['outputID.getUserID']] steps:
Azure Pipeline - Stage with Multiple depends on with if condition
Probably you are not setting the description properly. Log the description before the slack call and check whether you are getting the description correctly. Something like the one below works for me.currentBuild.description = "This is a Description" pipeline { agent any stages { stage('Test') { steps { echo "${currentBuild.description}" summary = "The Job ${currentBuild.description} worked" slackSend(channel: channel, color: colorCode, message: summary) } } } }ShareFollowansweredJul 18, 2022 at 0:09ycrycr13.9k22 gold badges2525 silver badges4949 bronze badges1sry for my later to reply, i will try and back to u, tnx for ur helping !–ask stackJul 21, 2022 at 19:17Add a comment|
I am using the slack notification plugin with Jenkins and I already set the notification settings in Jenkinsfile. I want to preview the job description on the Slack channel, and I am setting it on Jenkinsfile like this: Info:${currentBuild.description}but I am getting on the slack channel Info: NUll although I already putting a description on the job.
Cant get job description using Jenkins slack notifcation plugin with pipeline script
GPU rendering is completely asynchronous - callingglDraw...()just adds the draw command to a queue of commands that the GPU will process when it can.It's basically "2" in your question, except:Android goes through all draw calls and draws to the screen.is really:GPU hardware goes through all queued draw calls and draws to a back buffer.Display compositor swaps the front and back buffer when the back buffer is complete, and it is safe to do so (i.e. waiting for display vsync).If the application is limited by rendering performance at least one of your graphics API calls will stall waiting for a buffer to render in to. This is normallyeglSwapBuffers(), but doesn't have to be.ShareFolloweditedJul 15, 2022 at 22:56answeredJul 15, 2022 at 22:50solidpixelsolidpixel11.1k11 gold badge2121 silver badges3535 bronze badges2Where can I get more info about this?–user14587078Jul 16, 2022 at 2:43Cem Yuksel's video series is great as a general primer - but general "how does computer graphics work" is a large topic.youtube.com/playlist?list=PLplnkTzzqsZS3R5DjmCQsqupu43oS9CFN–solidpixelJul 16, 2022 at 8:06Add a comment|
I'm making an android game and I noticed that if I account only for the time spent in GLSurfaceView.Renderer (where I put all the graphics-related compuation), I have 300 fps, but if I account for the total amount of time per frame, I have 10 fps. So I was wondering, when I call GLES30.glDrawElements(); in android, does it stall the program and starts drawing or does it add a draw call to a list and goes throught it, drawing each draw call, in the background, between each update to the Activity or the SurfaceView?Is it 1:Android call update || Draw call || Drawing || Continue program || LoopsOr 2:Android call update || Draw call || Add to list || Continue program and exit GLSurfaceView || Android goes through all draw calls and draws to the screen. || Loops
does opengl es draw on the screen exactly on draw call?
Navigate to the Jobs tab.Select either All experiments to view all the jobs in an experiment or select All jobs to view all the jobs submitted in the Workspace.In the All jobs' page, you can filter the jobs list by tags, experiments, compute target and more to better organize and scope your work.Make customizations to the page by selecting jobs to compare, adding charts or applying filters. These changes can be saved as a Custom View so you can easily return to your work. Users with workspace permissions can edit, or view the custom view. Also, share the custom view with team members for enhanced collaboration by selecting Share view.To view the job logs, select a specific job and in the Outputs + logs tab, you can find diagnostic and error logs for your job.Refer thisofficial documentfor more informationRefer -https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/track-and-monitor-experiments/logging-api/logging-api.ipynbShareFollowansweredJul 18, 2022 at 11:48Abhishek KhandaveAbhishek Khandave3,16211 gold badge77 silver badges2020 bronze badgesAdd a comment|
I am using Azure AML and created training pipeline. I am tracking metrics like r2, mae etc. Metrics are available in ind. steps but not as "Job Metrics"Kindly help me track metrics at job level
I am using Azure AML and created training pipeline. tracking metrics like r2, mae available in "individual steps" but not in "job overview"
If you are talking about hosted runners, the changes will be discarded. If the file is part of your repository, you can check it in within your pipeline to persist the changes.ShareFollowansweredJul 14, 2022 at 10:16Martin BrandlMartin Brandl57.4k1414 gold badges139139 silver badges179179 bronze badgesAdd a comment|
Lets say one of the steps is replace content of one file with another file using CmdLine script task in yaml file. After pipeline runs do changes made to that file stick around or are they discarded?
Are changes made to files in azure pipeline discarded after pipeline runs?
This process would be the same the way to commit changes to a git repository.Initialize a git repository add the data in the staging area commit changes to local git repository then push the changes to remote git repository. The process isn't different from the normal local machine one.git init git add README.md git commit -m "first commit" git branch -M main git remote add origin <azure repo url > git push -u origin mainShareFollowansweredJul 17, 2022 at 22:22Mohit GanorkarMohit Ganorkar2,00622 gold badges66 silver badges1212 bronze badges1Thanks for answering. I understand, but the remote repository is private and I need to use SSH to push to repository. That is the problem since o don't know how to do that in azire–Alexandru UngureanuJul 19, 2022 at 4:59Add a comment|
I'm trying to find a way to use a pipeline to push the Azure repository to another repository on my cpanel server. At the moment I'm just transfering the files over FTP but I need a proper push to activate autodeploy on cpanel repo. Many thanks to anyone that can help.
Push from Azure repository to cpanel private repository
As it was mentioned in the comments,IsolationForesthas notransform()method indeed. However, you can likely write a transforming wrapper thyself (see thesimilar question). You'd likely have to resort to using imblearn pipeline however, otherwise the features and target length could mismatch.ShareFollowansweredJul 6, 2022 at 7:26dx2-66dx2-662,59622 gold badges55 silver badges1616 bronze badgesAdd a comment|
I would like to perform the steps I wrote in the pipeline but it gives me the following error:All intermediate steps should be transformers and implement fit and transform or be the string 'passthrough' 'IsolationForest ()' (type <class 'sklearn.ensemble._iforest.IsolationForest'>) doesn'tmy code is as follows:pipe = Pipeline([ ('scaling', None), ('anomaly', IsolationForest() ), ('balancing',None), ('classificator', SVC()) ]) params = {'scaling': [StandardScaler(), RobustScaler(), MinMaxScaler()], 'balancing':[RandomUnderSampler(),SMOTE()], 'balancing__random_state':45, 'balancing__k_neighbors':[3, 5, 7, 10], 'classificator__C': np.logspace(-2,1,4)} gs = GridSearchCV(estimator=pipe, param_grid = params) gs.fit(x_tr, y_tr)
how do i get my Grid Search CV with SVC to work?
I managed to achieve it like this:When creating the pipeline select the same bucket for theInput BucketandBucket(the output bucket)When creating a job you can choose an output folder:Output Key PrefixThe input object is selected by key, so you can choose a video in any folderEnter a file name as Output Key and select PresetStart the jobThe output file should be created in the input bucket in the folder you specified.ShareFollowansweredJul 7, 2022 at 8:05Цветан ИвановЦветан Иванов1,13111 gold badge88 silver badges88 bronze badgesAdd a comment|
I am putting together an AWS Elastic Pipeline to transcode the video however I want the input the pipeline takes to be from a folder in an AWS S3 bucket and the output to be sent to a different folder in the same AWS S3 bucket.I am not sure how to achieve this because the settings for setting up a pipeline strictly accept a bucket name and when I try to add a path it says it does not satisfy the regular expression pattern.What can I do to fix this? or is it even possible?
Use S3 bucket folders for Elastic Pipeline input bucket and output bucket
You can try to create NFS (Network File System) or something like WebDAV near your GitLab. Send there your file and run the pipeline after the update. Via pipeline, you can download files or read them.ShareFollowansweredJul 4, 2022 at 21:01Oleh KovalchynOleh Kovalchyn2333 bronze badgesAdd a comment|
i want to write gitlab ci.yml file to pull csv file from my local machine to gitlab repo these files changes everyday thats why i need to use ci pipline to pull new file to my repo can anyone help
How to do a simple pull with gitlab-ci.yml from local machine?
scoring_step = PythonScriptStep( name="Scoring_Step", source_directory=os.getenv("DATABRICKS_NOTEBOOK_PATH", "/Users/USER_NAME/source_directory"), script_name="./scoring.py", arguments=["--input_dataset", ds_consumption], compute_target=pipeline_cluster, runconfig=pipeline_run_config, allow_reuse=False)Change the above code block with below code block. It will resolve the errordata_ref = OutputFileDatasetConfig( name='data_ref', destination=(ds, '/data') ).as_upload() data_prep_step = PythonScriptStep( name='data_prep', script_name='pipeline_steps/data_prep.py', source_directory='/.', arguments=[ '--main_path', main_ref, '--data_ref_folder', data_ref ], inputs=[main_ref, data_ref], outputs=[data_ref], runconfig=arbitrary_run_config, allow_reuse=False )Reference link for thedocumentationShareFollowansweredJun 27, 2022 at 10:12Sairam TadepalliSairam Tadepalli1,60711 gold badge44 silver badges1111 bronze badgesAdd a comment|
We are defining in Databricks a PythonScriptStep(). When using PythonScriptStep() within our pipeline script we can't find the scoring.py file.scoring_step = PythonScriptStep( name="Scoring_Step", source_directory=os.getenv("DATABRICKS_NOTEBOOK_PATH", "/Users/USER_NAME/source_directory"), script_name="./scoring.py", arguments=["--input_dataset", ds_consumption], compute_target=pipeline_cluster, runconfig=pipeline_run_config, allow_reuse=False)We getting the following error message:Step [Scoring_Step]: script not found at: /databricks/driver/scoring.py. Make sure to specify an appropriate source_directory on the Step or default_source_directory on the Pipeline.For some reason Databricks is searching for the file in '/databricks/driver/' instead of the folder we entered.There is also the way to use DatabricksStep() instead of PythonScriptStep(), but because of specific reasons we need to use the PythonSriptStep() class.Could anybody help us with this specific problem?Thank you very much for any help!
Can't find scoring.py when using PythonScriptStep() in Databricks
You didn'tshowus your callable.Clearly you could synthesize a delta feature beforehand:df['feature_3'] = df.feature_1 - df.feature_2But it appears you want to do it as a transformer, fine.You're having trouble understanding / debugging the calling sequence, despite this example from the docs:transformer = FunctionTransformer(np.log1p)X = np.array([[0, 1], [2, 3]])transformer.transform(X)Ok. Here's a generic approach to figuring out callbacks. Don't bother computing a delta, just stick to debug output for now.def delta(*args, **kwargs): print(args) print(kwargs) breakpoint()Usethatin your pipeline and you'll see exactly how the callable is being called. Feel free to interrogate thetype( ... )of specific arguments, or usepprint.pp( ... )to format them.Once you have a good feel for how you're being called, you'll be in a better position to accept args of expected type and do the right computation with them.ShareFolloweditedJun 17, 2022 at 16:47answeredJun 17, 2022 at 16:42J_HJ_H19.4k44 gold badges2525 silver badges4646 bronze badgesAdd a comment|
I am trying to create a new feature which is based on the calculation of other two features from my dataset with aFunctionTransformerprobably from sklearn to include it inside aPipeline. for example if i havefeature_1andfeature_2and i want to createfeature_3which is substraction of one over the other (feature_3=feature_1-feature_2).if my df looks like thisdf feature_1 feature_2 2 1 3 2needed to create preprocessor which doesfeature_1-feature_2inside.
Creating feature with cross features inside my sklearn pipeline
Store the query in a variable. Then use theOLE DB Sourcecomponent in the Data Flow Task and set the 'data access mode' tosql command from variable.ShareFollowansweredJul 5, 2022 at 8:48Mostafa NZMostafa NZ38211 silver badge66 bronze badgesAdd a comment|
I am a newbie to SSIS and currently struggling with executing SQL task saving the result in a result set and exporting each table to a respective CSV using a data flow task.There are 15.sqlfiles stored in a folder which I am creating a variable calledFolderPathpointing towards them. Then I create a for each container that reads from a folder and create a variable in the variable mapping which is calledSQLfile.Inside thefor-eachcontainer I have an execute SQL task which I changed its file connection variable and edited the expression toFolderPath + SQLfile.Executing this loop works, when the result set value is set to none. Now I am trying to connect the tables created from this loop in a data flow task. I have no idea how to do this but I am guessing it has something to do with the result set. When I change the result set to full result set my loop breaks. I am assuming you cant have a result set inside a loop.Now I am completely lost as I don't know how to save the result of those 15 tables and how to declare them as source in the data flow task.
Export a folder of SQL queries into CSV in SSIS
Apologies Guys,I am answering my own question here.I made a mistake and sharing it here because I think I learned something very important.The reason that I was getting this error was because a category column'Embarked'also had null values in it, which were not present in the test_data set. So when I passed it toOneHotEncoder()in myfull_pipeline. It created four columns of 0 and 1 to distinguish between the four values ( 3 original values, 1 null), which my model thought to contain an extra feature.As soon as I removed the null rows everything went well.Learning:Always remove nulls values from your categorical columns before passing them to encoders.ShareFollowansweredJun 15, 2022 at 8:02SandeepSandeep6188 bronze badgesAdd a comment|
I am working on the introductoryTitanicproblem inKaggle. Here I wanted to design apipelineto pre-process data. I have written the following code for it:dropColumns = ['PassengerId','Name','Ticket','Cabin'] numColumns = ['Age','SibSp','Parch','Fare'] catColumns = ['Sex','Embarked']Num Pipeline:num_pipeline = Pipeline([ ('imputer',SimpleImputer(strategy="median")), ('std_scaler',StandardScaler()),])Full Pipeline:DataPreperationPipeline = ColumnTransformer([ ("num",num_pipeline,numColumns), ("cat",OneHotEncoder(),catColumns),])When I do:predictions = model.predict(test_prepared)Error I am getting:X has 9 features, but model is expecting 10 features as input.PS:This is the case with every model I am training. Even though before transformation test and train data has the same features.Please tell me what to do?
Getting diff. num of features in train and test data after passing through the same pipeline
TheExternalTaskSensoris designed for this.from airflow.sensors.external_task import ExternalTaskSensorThe documentation page isherewhich shows its usage (specifying execution dates, success states etc.).ShareFollowansweredJun 13, 2022 at 20:34Daniel TDaniel T55122 silver badges55 bronze badgesAdd a comment|
In my Airflow there are 2 types of DAGs:1st DAG Type (DT1) - loads data from source to Data Lake. These DAGs triggered by schedule.2nd DAG Type (DT2) - takes data Data Lake and does some transformations\aggregations\etc. These DAGs also can be triggered by schedule, but only if all required DT1 in status "success"What is the right way to implement next logic?Three DT1s - triggered each hour. One DT2 - triggered one time per day (~10 or 11 PM). But DT2 can be triggered only if all three DT1s for past hour in status "success".I'd prefer to implement it only with Airflow functionality.
Complex Airflow Cross-DAG Dependency
You should be able to use the Jenkins Artifacttory Plugin. Referthis.ShareFollowansweredJun 10, 2022 at 1:45ycrycr13.9k22 gold badges2525 silver badges4949 bronze badgesAdd a comment|
I'm trying to execute Build action for a dot net core application using Jenkins Pipeline (Cloudbees Jenkins). During the build, when the dotnet restore command is executed, necessary dependency has to be pulled from JFrog antifactory. As of now I have created a local repo, Remote repo and also Virtual repo as suggested by JFrog. What steps have to be taken to make the connection and configuration possible (All the way from Jenkins to Jfrog).Thanks in Advance.
Nuget.config file setup in Jenkins (From Jfrog Artifactory)
The short answer is yes, you can template out pipeline patterns and even automate the creation of pipelines.The longer answer of how to accomplish this is going to depend on the details of what you're trying to accomplish. On the simpler end, you can create a classic parent-child pipeline setup where a parent pipeline is fetching the configuration to pass into parameterized child pipelines. This works well in a lot of situations - especially where there is a clear common pattern to your data load. You can look at this documentation for more information on using parameters with your pipelines:How to use parameters, expressions and functions in Azure Data FactoryFrom a more complicated perspective, the pipelines are nothing but json documents that define the flow of the pipeline. This json can be generated and purpose built for you data load needs. It can also be managed outside of the ADF/Synapse environment which may have some advantages as well.If you can provide some more details of your exact scenario I can likely give more details on what a possible solution would look like.ShareFollowansweredJun 1, 2022 at 18:32MrVitaminPMrVitaminP10644 bronze badgesAdd a comment|
I am building a new data pipeline for our team. This data pipeline would collect data from multiple sources and ingest them into a single table. I am looking into a couple of options within Azure to achieve this (Synapse being the main option). I was only able to create a pipeline using the Synapse Studio. In the future I might need to add in other source tables without any manual configurations through the UI (1000s of source tables). I was wondering if there is a way to automatically build pipes using some sort of template. Is there any other equivalent to achieve this if not? Thanks!
Data Pipeline using Azure Data Factory or Azure Synapse
Try using docker specific runner and set environment in your config.tomal file. My docker specific runner config is below. [[runners]] name = "Docker-runner" url = "https://gitlab.com" id = ******* token = "****************" token_obtained_at = *********** token_expires_at = ********** executor = "docker" environment = ["MAVEN_HOME=C:/Softwares/Maven/apache-maven-3.8.6/bin"] [runners.custom_build_dir] [runners.cache] MaxUploadedArchiveSize = 0 [runners.cache.s3] [runners.cache.gcs] [runners.cache.azure] [runners.docker] tls_verify = false image = "latest" privileged = false disable_entrypoint_overwrite = false oom_kill_disable = false disable_cache = false volumes = ["/cache"] shm_size = 0ShareFollowansweredNov 30, 2022 at 6:25vanshika sharmavanshika sharma111 bronze badge1Your answer could be improved with additional supporting information. Pleaseeditto add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answersin the help center.–CommunityBotDec 4, 2022 at 11:49Add a comment|
trying build maven project using gitlab specific runner getting error My .gitlab-ci.yml contentvariables: MAVEN_OPTS: -Dmaven.repo.local=.m2/repository image: maven:latest stages: - build - test - package - deploy cache: paths: - .m2/repository - target build_job: stage: build tags: - docker script: - echo "Maven compile started" - "mvn compile" test_job: stage: test tags: - docker script: - echo "Maven test started" - "mvn test" package_job: stage: package tags: - docker script: - echo "Maven packaging started" - "mvn package" Deploy_job: stage: deploy tags: - docker script: - echo "Maven deploy started" error : $ mvn compile mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\WINDOWS\TEMP\build_script1691068991\script.ps1:243 char:1 + mvn compile + ~~~ + CategoryInfo : ObjectNotFound: (mvn:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
The term 'mvn' is not recognized as the name of a cmdlet in gitlab ci cd pipeline yaml file
Fixed by added.replace("[", "").replace("]", "")ShareFollowansweredJun 1, 2022 at 10:52Avner VidalAvner Vidal1Add a comment|
I added the below to the pipeline so while the pipeline is running - at some stage I want the user to choose from the parameters but the output returns with parentheses at beginning and end.def envs = input(id: 'Upgarde', message: 'On which customer do you want to apply the upgrade?', submitter: 'admin', ok: 'Submit', parameters: [extendedChoice(defaultValue: env.ENV.split().toString(), description: '', descriptionPropertyValue: env.ENV.split().toString(), multiSelectDelimiter: '', name: 'Customers to upgrade', quoteValue: false, saveJSONParameterToFile: false, type: 'PT_MULTI_SELECT', value: env.ENV.split().toString())]).split(',')Screenshot from the Jenkins UI:enter image description here
Jenkins pipeline with userinput extendedChoice returns the values with [ ] at the beginning and end
The last step in yourscriptblock isexit 1. Gitlab CI will fail any job that has an exit code > 0.Thecommit-message-validatorjob doesn't currently do any checks, it simply callsecho3 times. If you want it to check forfix, feat, major, minoryou will need to do write some logic in thescriptblock to do so.ShareFollowansweredMay 30, 2022 at 16:26swysockiswysocki93677 silver badges88 bronze badgesAdd a comment|
commit-message-validator: stage: validate-commit-message script: - echo "$CI_COMMIT_MESSAGE" - echo "$CI_COMMIT_BRANCH" - echo "check the Prefix of the commit message should have one of 'fix' || 'feat' || 'major' || 'minor' in case sensitive" - exit 1rules: - if: $CI_COMMIT_MESSAGE =~ /fix:/ when: never - if: $CI_COMMIT_MESSAGE =~ /feat:/ when: never - if: $CI_COMMIT_MESSAGE =~ /major:/ when: never - if: $CI_COMMIT_MESSAGE =~ /minor:/ when: never - if: "$CI_COMMIT_MESSAGE =~ /^chore\(release\):.*/" when: never - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: never - when: alwaysenter image description here
why im getting Cleaning up file based variables 00:01 ERROR: Job failed: exit code 1 in gitlab pipeline creation
As suggested by Topaco, I tried another simpler way to encrypt and decrypt :Encrypt:openssl aes-256-cbc -a -salt -pbkdf2 -in server.key -out server.key.enc -k <password>Decrypt:openssl aes-256-cbc -d -a -pbkdf2 -in server.key.enc -out server.key -k <password>as mentioned here :How to use OpenSSL to encrypt/decrypt files?And it works betterShareFollowansweredMay 27, 2022 at 6:32vanessenvanessen1,21011 gold badge1313 silver badges1919 bronze badgesAdd a comment|
My context is that I am using jwt token flow to connect to SF in bitbucket pipeline. I have been able to correctly generate a certificate and key etc as required. I tested the key it is working fine. Next step was to add security, and did not wanted to store my key in the project, thus I encrypted the key like this :openssl enc -nosalt -aes-256-cbc -in server.key -out server.key.enc -base64 -K <key-value> -iv <iv-value>Now I am storing the encrypted server.key.enc file in my project and then stored the key and iv value as protected bitbucket variables (DECRYPTION_KEY and DECRYPTION_IV)Now before login to the org, I need to decrypt the server.key.enc to server.key so that I can use this file to login, but when doing so using following cmd, it is not working properly :openssl enc -nosalt -aes-256-cbc -d -in key/server.key.enc -out key/server.key -base64 -K $DECRYPTION_KEY -iv $DECRYPTION_IVThe server.key file has only the header malformed but the footer is well generatedEXPECTED :-----BEGIN RSA PRIVATE KEY----- ........... -----END RSA PRIVATE KEY-----GOT :-��}�5��n�S�*��RIVATE KEY----- ........... -----END RSA PRIVATE KEY-----Thus my pipeline finish with following error :ERROR running auth:jwt:grant: We encountered a JSON web token error, which is likely not an issue with Salesforce CLI. Here’s the error: error:0909006C:PEM routines:get_name:no start lineIt seems like I missing a small parameter somewhere, but could not locate where.
SSL decryption not generating the begin type correctly