From b5f745b4cd6a7b23986e0e182b66bd34f1304704 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 8 Jun 2023 11:56:29 -0400 Subject: [PATCH] warn of modified files --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/extension_report.yml | 8 +++++- README.md | 4 +-- TODO.md | 1 + installer.py | 31 ++++++++++++++------- launch.py | 2 ++ 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index add464bca..9347c4bf6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -28,7 +28,7 @@ body: - type: markdown attributes: value: | - If issue is setup, installation or startup related, please check `webui.log` before reporting + If issue is setup, installation or startup related, please check `sdnext.log` before reporting And when posting console logs, please use code blocks ( \`\`\` ) to format them insead of uploading screenshots - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/extension_report.yml b/.github/ISSUE_TEMPLATE/extension_report.yml index 21e95688a..88c590307 100644 --- a/.github/ISSUE_TEMPLATE/extension_report.yml +++ b/.github/ISSUE_TEMPLATE/extension_report.yml @@ -22,6 +22,12 @@ body: label: URL link of the extension description: URL link of the extension value: + - type: textarea + id: url + attributes: + label: URL link of the issue reported in the extension repository + description: Any extension related issue must also be reported to extension repository as well + value: - type: markdown attributes: value: | @@ -29,5 +35,5 @@ body: - type: markdown attributes: value: | - If issue is extension installation or startup related, please check `webui.log` before reporting + If issue is extension installation or startup related, please check `sdnext.log` before reporting And when posting console logs, please use code blocks ( \`\`\` ) to format them insead of uploading screenshots diff --git a/README.md b/README.md index 6b06f20df..c400a63f3 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ Individual features are not listed here, instead check [Changelog](CHANGELOG.md) 3. Run launcher `webui.bat` or `webui.sh`: - Platform specific wrapper scripts For Windows, Linux and OSX - - Starts `launch.py` in a Python virtual environment (`venv`) + - Starts `sdnext.py` in a Python virtual environment (`venv`) - Uses `install.py` to handle all actual requirements and dependencies - *Note*: Server can run without virtual environment, but it is recommended to use it to avoid library version conflicts with other applications *Note*: **nVidia/CUDA** and **AMD/ROCm** are auto-detected is present and available, but for any other use case specify required parameter explicitly or wrong packages may be installed as installer will assume CPU-only environment -Full startup sequence is logged in `webui.log`, so if you encounter any issues, please check it first +Full startup sequence is logged in `sdnext.log`, so if you encounter any issues, please check it first Below is partial list of all available parameters, run `webui --help` for the full list: diff --git a/TODO.md b/TODO.md index 10f7d05a3..8c450f503 100644 --- a/TODO.md +++ b/TODO.md @@ -58,3 +58,4 @@ Tech that can be integrated as part of the core workflow... - port `p.all_hr_prompts` - test `lyco_patch_lora` - fix `lyco` logging +- git diff index diff --git a/installer.py b/installer.py index 0488b3a59..dce439f18 100644 --- a/installer.py +++ b/installer.py @@ -20,7 +20,7 @@ class Dot(dict): # dot notation access to dictionary attributes log = logging.getLogger("sd") -log_file = os.path.join(os.path.dirname(__file__), 'webui.log') +log_file = os.path.join(os.path.dirname(__file__), 'sdnext.log') quick_allowed = True errors = 0 opts = {} @@ -343,6 +343,18 @@ def check_torch(): print_profile(pr, 'Torch') +# check modified files +def check_modified_files(): + if args.skip_git: + return + try: + res = git('status --porcelain') + files = [x[2:].strip() for x in res.split('\n')] + log.warning(f'Modified files: {files}') + except: + pass + + # install required packages def install_packages(): if args.profile: @@ -415,17 +427,20 @@ def run_extension_installer(folder): log.error(f'Exception running extension installer: {e}') # get list of all enabled extensions -def list_extensions(folder): +def list_extensions(folder, quiet=False): name = os.path.basename(folder) disabled_extensions_all = opts.get('disable_all_extensions', 'none') if disabled_extensions_all != 'none': - log.info(f'Disabled {name}: {disabled_extensions_all}') + if not quiet: + log.info(f'Disabled {name}: {disabled_extensions_all}') return [] disabled_extensions = opts.get('disabled_extensions', []) if len(disabled_extensions) > 0: - log.info(f'Disabled {name}: {disabled_extensions}') + if not quiet: + log.info(f'Disabled {name}: {disabled_extensions}') enabled_extensions = [x for x in os.listdir(folder) if x not in disabled_extensions and not x.startswith('.')] - log.info(f'Enabled {name}: {enabled_extensions}') + if not quiet: + log.info(f'Enabled {name}: {enabled_extensions}') return enabled_extensions @@ -446,7 +461,7 @@ def install_extensions(): for folder in extension_folders: if not os.path.isdir(folder): continue - extensions = list_extensions(folder) + extensions = list_extensions(folder, quiet=True) log.debug(f'Extensions all: {extensions}') for ext in extensions: if ext in extensions_enabled: @@ -582,10 +597,6 @@ def check_version(offline=False, reset=True): # pylint: disable=unused-argument log.error('Not a git repository') if not args.ignore: sys.exit(1) - # status = git('status') - # if 'branch' not in status: - # log.error('Cannot get git repository status') - # sys.exit(1) ver = git('log -1 --pretty=format:"%h %ad"') log.info(f'Version: {ver}') if args.version: diff --git a/launch.py b/launch.py index 7fb712fa0..76e6e9144 100644 --- a/launch.py +++ b/launch.py @@ -151,11 +151,13 @@ if __name__ == "__main__": installer.check_version() installer.set_environment() installer.check_torch() + installer.check_modified_files() if args.reinstall: installer.log.info('Forcing reinstall of all packages') installer.quick_allowed = False if installer.check_timestamp(): installer.log.info('No changes detected: Quick launch active') + installer.check_extensions() else: installer.install_requirements() installer.install_packages()