Key 'optuna_config' not in 'OptunaSweeperConf' full_key: hydra.sweeper.optuna_config object_type=OptunaSweeperConf - yaml

I tried this tutorial but gives me this error Key 'optuna_config' not in 'OptunaSweeperConf' full_key: hydra.sweeper.optuna_config object_type=OptunaSweeperConf
why is this error?
this is my config.yaml
hydra:
run:
dir: ./outputs/${model._target_}/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweeper:
optuna_config:
direction: maximize
study_name: mnist
storage: null
n_trials: 20
n_jobs: 1
sampler: tpe
seed: 123

It seems to be a version error, the structure of optuna sweeper changed in hydra 1.2.0 and optuna 2.10.1
this config worked for me I only had to add 'sampler to the structure'
hydra:
run:
dir: ./outputs/${model._target_}/${now:%Y-%m-%d}/${now:%H-%M-%S}
sweeper:
sampler:
seed: 123
direction: maximize
study_name: sphere
storage: null
n_trials: 5
n_jobs: 1

Related

Error: Unable to merge GraphQL directive "abstractEntity" in graphql-codegen

Codegen worked fine with "#graphql-codegen/add": "^3.1.0", "#graphql-codegen/cli": "1.21.7", "#graphql-codegen/typescript": "1.23.0", "#graphql-codegen/typescript-resolvers": "1.20.0", "#graphql-codegen/typescript-mongodb": "^1.19.5", and then accidently updated all packages to latest. Then got TypeError:
yarn gen
√ Parse configuration
> Generate outputs
> Generate ./src/generated/graphql.ts
√ Load GraphQL schemas
√ Load GraphQL documents
× Generate
→ directive #abstractEntity(additionalFields: [AdditionalEntityFields], discriminatorField: String!) on INTERFACE
Found 1 error
✖ ./src/generated/graphql.ts
Error: Unable to merge GraphQL directive "abstractEntity".
Existing directive:
directive #abstractEntity(discriminatorField: String!, additionalFields: [AdditionalEntityFields]) on INTERFACE
Received directive:
directive #abstractEntity(additionalFields: [AdditionalEntityFields], discriminatorField: String!) on INTERFACE
at validateInputs (<path-to-project>\node_modules\#graphql-tools\merge\index.js:162:15)
at mergeDirective (<path-to-project>\node_modules\#graphql-tools\merge\index.js:167:9)
at mergeDirective (<path-to-project>\node_modules\#graphql-tools\merge\index.js:167:9)
at mergeGraphQLNodes (<path-to-project>\node_modules\#graphql-tools\merge\index.js:589:49)
at mergeGraphQLTypes (<path-to-project>\node_modules\#graphql-tools\merge\index.js:658:25)
at Object.mergeTypeDefs (<path-to-project>\node_modules\#graphql-tools\merge\index.js:605:22)
at makeExecutableSchema (<path-to-project>\node_modules\#graphql-tools\schema\index.js:496:38)
at Object.mergeSchemas (<path-to-project>\node_modules\#graphql-tools\schema\index.js:534:12)
at Object.codegen (<path-to-project>\node_modules\#graphql-codegen\core\index.js:128:18)
at process (<path-to-project>\node_modules\#graphql-codegen\cli\bin.js:1003:67)
at Array.map (<anonymous>)
Something went wrong
my codegen config
hooks:
afterAllFileWrite:
- prettier --write
require:
- ts-node/register
overwrite: true
schema: ./src/types/index.ts
definitions:
add: &top-comment
content: >
/* eslint-disable */
generates:
./src/generated/graphql.ts:
plugins:
- add: *top-comment
- 'typescript'
- 'typescript-mongodb'
- 'typescript-resolvers'
config:
avoidOptionals: true
useIndexSignature: true
scalars:
DateTime: Date
EmailAddress: string
NonNegativeFloat: number
NonNegativeInt: number
I tried roll back the updated packages. But now error is not getting disappeared.
Error Recreated in: https://codesandbox.io/s/relaxed-perlman-mdrwp

How can I fix yaml error: Block mapping value not allowed here

I copied Semaphore's config of GoReleaser and saved it as .semaphore/semaphore.yml but when I run it on Semaphore, I can see:
Unprocessable YAML file.
Error: {{:throw, {:yamerl_exception, [{:yamerl_parsing_error, :error, 'Block mapping value not allowed here', 30, 20, :block_mapping_value_not_allowed, :undefined, []}]}}, "# .semaphore/semaphore.yml.\nversion: v1.0\nname: Build\nagent:\n machine:\n type: e1-standard-2\n os_image: ubuntu1804\n\nblocks:\n - name: \"Test\"\n task:\n prologue:\n commands:\n # set go version\n - sem-version go 1.11\n - \"export GOPATH=~/go\"\n - \"export PATH=/home/semaphore/go/bin:$PATH\"\n - checkout\n\n jobs:\n - name: \"Lint\"\n commands:\n - go get ./...\n - go test ./...\n\n# On Semaphore 2.0 deployment and delivery is managed with promotions,\n# which may be automatic or manual and optionally depend on conditions.\npromotions:\n - name: Release\n pipeline_file: goreleaser.yml\n auto_promote_on:\n - result: passed\n branch:\n - \"^refs/tags/v*\"\n"}
How can I fix it?
In this last part:
promotions:
- name: Release
pipeline_file: goreleaser.yml
auto_promote_on:
- result: passed
branch:
- "^refs/tags/v*"
The indentation of pipeline_file and auto_promote_on is wrong – both need to be at the same level as name.

YAML ERROR : mapping values are not allowed

I am trying to build a yaml file but I am getting mapping not allowed error.
name: n1
version: "testv1"
description: n1
icon: n1.png
roles: [postgres]
postgres:
   name: postgreSQL database
   image:
       name: "r/k/postgres/"
       version: "testv1"
       engine: docker
   compute:
       memory: 2G
       cpu:
           reserve: false
           cores: 2
   storage:
       - type: data1
         media: hdd
         path: /var/lib/postgresql/data/pgdata
size: 30G
count: 1
fixed: true
service_ports: [5432]
env:
POSTGRES_PASSWORD:
type: password
value: "postgres"
POSTGRES_DB: postgres
POSTGRES_USER: postgres
(): mapping values are not allowed in this context at line 21 column 14
I cant understand the error on line : size: 30G
Try adding double quotes to the following:
path: "/var/lib/postgresql/data/pgdata"
Also, indentation of keys in the map should be exactly same. Try seeing that the indentation is correct. So, for example, if you are using 3 spaces to indent a key, then every key should be indented with 3 spaces only.

Getting exception while running SaltStack module.run function with name dsc.apply_config

I'm getting the following error while trying to state.apply sls on windows machine.
ID: ProvisionADDC
Function: module.run
Name: dsc.apply_config
Result: False
Comment: Module function dsc.apply_config threw an exception. Exception: No JSON results from powershell. Additional info follows:
retcode:
0
stderr:
stdout:
Started: 12:06:08.044000
Duration: 2684.0 ms
Changes:
Since win_dsc is execution module, then I'm forced to use state.module module to run this function on minion:
C:\DSC:
file.directory:
- makedirs: True
allprofiles:
win_firewall.disabled
CopyDSCModules:
file.recurse:
- name: 'C:\Program Files\WindowsPowerShell\Modules'
- source: salt://windows/dsc/
InstallADDomainServices:
win_servermanager.installed:
- name: AD-Domain-Services
- restart: True
- require:
- file: CopyDSCModules
ProvisionADDC:
module.run:
- name: dsc.apply_config
- path: C:\DSC\
- source: salt://windows/mof
- require:
- file: 'C:\DSC'
- file: CopyDSCModules
- win_servermanager: InstallADDomainServices
Anybody have experience with win_dsc and SaltStack ?
I think it's a case of the documentation lacking a bit, but you need to actually run the configuration in the same ps1 file, eg.
Configuration myconfig {
Node 'localhost' {
WindowsFeature 'DNS' {
Name = 'DNS'
Ensure = Present
}
}
}
myconfig
I'm playing with this a litle at the moment and hopefully I can come up with a helpful issue/PR because it is lacking a bit (even if just for better error logging).
I'm not sure how this works in terms of determining a specific config as I'e not tested that yet (using the config_name param).

Curator 4.0 : Unable to take snapshot or run any action. Following examples from the document

I am trying to take snapshot of elastic index using curator 4. (Windows machine)
Getting below error (Getting same error for all actions).
Failed to complete action: snapshot. : Not an IndexList object. Type:
Any idea when we get this ?
I am following the examples provided in the documentation
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/snapshot.html
Action yaml file :
actions:
1:
action: snapshot
description: >-
Snapshot logstash- prefixed indices older than 1 day (based on index
creation_date) with the default snapshot name pattern of
'curator-%Y%m%d%H%M%S'. Wait for the snapshot to complete. Do not skip
the repository filesystem access check. Use the other options to create
the snapshot.
options:
repository: myrepo
name: shan
ignore_unavailable: False
include_global_state: True
partial: False
wait_for_completion: True
skip_repo_fs_check: False
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: age
source: creation_date
direction: younger
unit: days
unit_count: 1
field:
stats_result:
epoch:
exclude:
OutPut :
2016-07-25 22:16:40,929 INFO Action #1: snapshot
2016-07-25 22:16:40,929 INFO Starting new HTTP connection (1): 127.0.0.1
2016-07-25 22:16:40,944 INFO GET http://127.0.0.1:9200/ [status:200 request:0.015s]
2016-07-25 22:16:40,946 INFO GET http://127.0.0.1:9200/_all/_settings?expand_wildcards=open%2Cclosed [status:200 request:0.002s]
2016-07-25 22:16:40,950 INFO GET http://127.0.0.1:9200/_cluster/state/metadata/.marvel-es-1-2016.06.27,.marvel-es-1-2016.06.28,.marvel-es-1-2016.06.29,.marvel-es-1-2016.06.30,.marvel-es-data-1,shan-claim-1 [status:200 request:0.004s]
2016-07-25 22:16:40,993 INFO GET http://127.0.0.1:9200/.marvel-es-1-2016.06.27,.marvel-es-1-2016.06.28,.marvel-es-1-2016.06.29,.marvel-es-1-2016.06.30,.marvel-es-data-1,shan-claim-1/_stats/store,docs [status:200 request:0.042s]
2016-07-25 22:16:40,993 ERROR Failed to complete action: snapshot. <class 'TypeError' at 0x000000001DFCC400>: Not an IndexList object. Type: <class 'curator.indexlist.IndexList' at 0x0000000002DB39B8>.
You need to add another filtertype so curator knows which indexs to run against. For example if your indexes are named logstash- your filters would look like
filters:
- filtertype: pattern
kind: prefix
value: logstash-
exclude:
- filtertype: age
source: creation_date
direction: younger
unit: days
unit_count: 1
field:
stats_result:
epoch:
exclude:
There is a bad identation at the beginning of yourfile. The acion list should be within the "actions" keyword. This is your root level.

Resources