-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Input Validation #2466
base: pub/new_architecture
Are you sure you want to change the base?
User Input Validation #2466
Conversation
Can one of the admins verify this patch? |
- name: Find input directories | ||
ansible.builtin.find: | ||
paths: "{{ omnia_base_dir }}" | ||
file_type: directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this need to be from NFS share
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include input project directory utility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, now as default it points to /opt/omnia/input/project_default/ and grabs all json and yml files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project_default this can be different. Based on /opt/omnia/.data/default.yml file. Better we import utility utils/include_input_dir.yml
--- | ||
- name: Include variables | ||
ansible.builtin.include_vars: | ||
file: vars/vars.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use main.yml instead of vars.yml. this task not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
|
||
# dict to hold the file names. If any file's name changes just change it here. | ||
files = { | ||
"accelerator_config": "accelerator_config.yml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acellerator_config , network_config is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed accelerator_config and rhsm_config, but I left network_config just in case an user wants to validate network_config by providing its tag. It's not necessarily running everytime unless --tags network_config is provided
"passwordless_ssh_config": "passwordless_ssh_config.yml", | ||
"provision_config_credentials": "provision_config_credentials.yml", | ||
"provision_config": "provision_config.yml", | ||
"rhsm_config": "rhsm_config.yml", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhsm_config is not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
from datetime import datetime | ||
import os | ||
|
||
omnia_log = '/var/log/omnia' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/opt/omnia/log/core/playbooks/input_validator/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
omnia_log = '/var/log/omnia' | ||
|
||
module_log_dir = { | ||
"omnia": omnia_log + "/_"+ datetime.now().strftime('_%d-%m-%Y.log') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to input_validator_log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
all functions should have doc string |
This reverts commit 04f5249.
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Configuration Schema", | ||
"type": "object", | ||
"properties": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean the network_config schema is not needed?
"type": "object", | ||
"properties": { | ||
"Networks": { | ||
"type": "array", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are changes in network_spec.yml
"pattern": "^[a-zA-Z0-9._-]+$" | ||
}, | ||
"domain_name": { | ||
"type": "string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
provision_config.yml will not be having iso_file_path, node_name and switch details
"items": { | ||
"type": "object", | ||
"patternProperties": { | ||
"^[a-zA-Z0-9_-]+$": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server spec has metric value added now
}, | ||
"required": [ | ||
"nfs_client_params", | ||
"beegfs_mgmt_server", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beegfs details are not mandatory always
], | ||
"if": { | ||
"properties": { | ||
"docker_username": { "type": "string", "minLength": 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file will be having changes
"required": [ | ||
"ansible_config_file_path", | ||
"mariadb_password", | ||
"slurm_installation_type", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing some variables in omnia_config.yml
"properties": { | ||
"gpgkey": { | ||
"type": "string", | ||
"format": "uri" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repo_store_path is removed now. ubuntu and rocky urls not present
Signed-off-by: youngjae-hur7 <[email protected]>
…nput validation for HA config by providing tags
ansible.builtin.find: | ||
paths: "/opt/omnia/input" | ||
file_type: directory | ||
patterns: 'project_default' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For nfs shared input dir utils/include_input_dir.yml can be used.
Format and logic validation on all user input files.